UpdateCurrencies functions

User avatar
rbytes
Posts: 1906
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone X
iPad 4
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Update currencies

Post by rbytes » Fri Nov 02, 2018 10:05 pm

I have reread the above several times and still don't fully understand it. As long as Update Currencies remains a separate program and iConvert still contains an include statement for currencies.data, users will not be able to run IConvert until after they run Update Currencies or create the two-line dummy data file.

In the most recent post (3.3), I modified Update Currencies to have an interactive and a silent mode. I renamed it Launch iConvert, and it does that after it has saved the currencies.data file. It also harmonizes with the look and color scheme of the main program by running in graphics rather than text mode, with the same title and screen color. My next step would be to add the buttons in iConvert that would run it during a session, and also set the preferred mode to interactive or silent.

Please give it a try and let me know how it works for you. If necessary we can combine our changes.
####### Living the colorful life #######

User avatar
Dutchman
Posts: 886
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: Update currencies

Post by Dutchman » Fri Nov 02, 2018 10:21 pm

Yes the problem of missing include-file remains.
However "Update currencies" has now a silent mode which can be run from inside iConvert and it returns to iConvert.
So "Update currencies" can now be made an integral part of iConvert, but "Update currencies" should be run if iConvert is used for the first time.
Therefore I made the following proposal as reply to "iConvert 3.3"
Richard, I suggest that when you present the code, you add a note that
"Update currencies" https://kibernetik.pro/forum/viewtopic.php?f=20&t=2272 must first be run before iConvert is suitable for use.
We consider it a refreshing mental exercise to figure out ways to circumvent foolishness (Quote from Richard)

User avatar
Dutchman
Posts: 886
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: Update currencies

Post by Dutchman » Mon Nov 05, 2018 11:00 am

Obsolete
The truth-table is no longer valid
Functions will be integrated in iConvert
Truth table for View and Convert.JPG
Truth table for View and Convert.JPG (44.7 KiB) Viewed 735 times
Last edited by Dutchman on Sat Nov 10, 2018 8:13 pm, edited 1 time in total.
We consider it a refreshing mental exercise to figure out ways to circumvent foolishness (Quote from Richard)

User avatar
rbytes
Posts: 1906
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone X
iPad 4
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Update currencies

Post by rbytes » Mon Nov 05, 2018 3:00 pm

Nice job on Update Currencies 2.1. :D

A suggestion for future versions - a method to set the currencies that the user wants to see, and hide the remainder. This could be changed at any time they choose. It would mean less scrolling of the measures lists to get to the currencies they want.
####### Living the colorful life #######

User avatar
Dutchman
Posts: 886
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: Update currencies

Post by Dutchman » Wed Nov 07, 2018 9:31 pm

Updated to version 2.2 with handling "viewstate" for iConvert 2.6
We consider it a refreshing mental exercise to figure out ways to circumvent foolishness (Quote from Richard)

User avatar
Dutchman
Posts: 886
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: UpdateCurrencies functions

Post by Dutchman » Sat Nov 10, 2018 8:18 pm

I have changed the program to the bare basics: generate the data-file.
The program is a test-program now and does no longer continue with a call to iConvert.
To simplify integration with iConvert, I have recoded subroutines to functions.
Call to iConvert is removed
Essential tasks are coded in functions on red background:
- MakeCurrencyHTML (Url$,HtmlFile$,iview,iField$,Browser$)
- ExtractHtml (HtmlFile$,Data$(,))
- SortAndStore (File$,Data$(,),items)
Additional REQUIRED utility functions are coded on blue background:
- Input$ (Field$,Prompt$)
- Quicksort$ (Array$(,),MaxRow,Rowsize,SortColumn)
- PageContent$ (file$)
- ISO_Date$

The testprogram is an example of application.
We consider it a refreshing mental exercise to figure out ways to circumvent foolishness (Quote from Richard)

User avatar
Dutchman
Posts: 886
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: UpdateCurrencies functions

Post by Dutchman » Mon Nov 12, 2018 9:23 pm

I have reduced the main section of the program by the addition of the startfunction "Update"
Preparation of the update requires now only the set up of
• Browser if view is active, to display the web-contents
• Interface-field
This field is at the top of the display in the testprogram and gives messages about progress and errors.
Progress-messages are on blue background, whereas interactivity requests and error-messages are on red background

I have integrated this version into iConvert and will publish it as "iConvert 4 alpha.sb"
We consider it a refreshing mental exercise to figure out ways to circumvent foolishness (Quote from Richard)

Post Reply