No, you only have to set the value and it gets written to the .ini file at
that time.
 
Chip
 

  _____  

From: David [mailto:[email protected]] 
Sent: Friday, September 09, 2011 5:31 PM
To: [email protected]
Subject: Re: What is the best way to store a dictionary?


OK, Bruce, thanks. I really hoped for something like that. Don't know, why I
got it that an INI file only could hold whole numbers.
 
Have one short question more. When setting the value for an INI key, will I
have to perform any further action so as to save the change physically to
the file? Or will the set function provided by GW automatically save any
changes in the value to my INI file?
 
I did look around, but did see no 'write' or 'save' instructions for the INI
file object. Did I overlook something?
 
Thanks again,
 

----- Original Message ----- 
From: bb <mailto:[email protected]>  
To: [email protected] 
Sent: Friday, September 09, 2011 11:15 PM
Subject: Re: What is the best way to store a dictionary?

Hi Dave,
 
    You can look at my Cuckoo Clock app and note that I place fractional
values inside my Ini file and you can convert the values back and forth
using the CStr() function or the CSng and all those numeric functions to
store your data.
 
    You can create a dictionary file if you want to load a file from the
folder but the advantage inside an Ini file is you can group the stuff and
reference the group. It will be blocked off from other parts of the Ini file
and easy to edit or extract from.
 
    So, look at the numeric translations from string to numbers and you good
to go in your Ini file.
 
        Bruce
 
Sent: Friday, September 09, 2011 5:04 PM
Subject: What is the best way to store a dictionary?


Obviously I don't know much about storing things, from a script. Smile.
 
My problem is, that I need to store information, holding two 'columns'. I
thought at first of using a dictionary. Secondly I was considering the usage
of the app's INI file. But I am really not sure any longer, what would be
the way to handle this the most smart. Thing is that I need to store info
like:
 
    Australia    6.5
    USA    5.55
    Denmark    1.0398
    Europe    9.02
 
As you can see, I will need a set of 'keys', with textual names. These has
to go along with a corresponding set of decimal numbers. 
 
As I said, I was considering using the INI file. But somehow, I got it from
the reference manual of WE, that you only can store integers for the INI
file. Is that so, or am I messing up my mind here.
 
I then thought of using the XML file, and store a set of strings there. But
these would have to be seperate from other strings in the XML file, or how
would my app distinguish them from strings of more general kind in my XML
file. Is there a way of 'grouping' strings in the XML? The benefit of the
XML, of course, would have been that I could have translated the textual
keys into each languge supported; of which there would be no way in the INI
file. But it is not a too big problem, since the info the user really would
need to get in touch with here, is the set of decimal values; hence he might
not care too much of the textual notation. 
 
Any good workaround for my issue? Thanks,
 

Reply via email to