David, Since these are constant values, you can just store them in a
simple dictionary. INI files are really for storing values that might
change and need to retain their new value even if the script is stopped.
For example, a lot of user preference data stored as INI files so a user
doesn't set options and have them switch back every time the script is
run. However, for values like this which aren't modified by the user
across multiple sessions, a simple dictionary will suffice.
dim MyDict
set MyDict = CreateObject("Scripting.Dictionary")
MyDict.add "Australia", 6.5
MyDict.add "USA", 5.5
MyDict.add "Denmark", 1.03
print MyDict("Australia")
6.5
HTH
On 9/9/2011 5:04 PM, David wrote:
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,