I am trying to use vbscript's Eval (or maybe I need Execute) to create some variables from the key names from an ini file. The ini file can have unlimited unknown key=val pairs. I need to create a variable based on the key name no matter what.
Ini File contents:
myPath=c:est
myExe=myapp.exe
....
xxx=123
yyy=abc
My code that reads the ini and returns the key and values to an object
The code I am trying to get working is here:
For each pair in objINI
Eval("pair.key=pair.val")
Next
msgbox myPath
msgbox myExe
But both msgbox's are showing empty
And yes I am sure pair.key and pair.val have the correct values.
Thoughts on what I am missing or if this is even possible?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…