Code: Select all
For each VariableNameString in Array
FileAppend, % VariableNameString . "=" . %VariableNameString% . "`n", % SaveFile.txt
Code: Select all
UserName=MyUser
UserMode=2
NumberOfThings=15
EDIT: I figured this out, I think. I thought that you had to use a key value pair object; I didn't realize a normal array would work, and I also didn't realize that "key" is the index of the array, not the value at that index. Which... should be obvious I suppose... I'm just bad at objects. ^^;
If anyone wants working code for this, it looks like this:
Code: Select all
VarsToSave := ["Variable1", "Variable2", "Variable3"]
For Key, Value in VarsToSave
FileAppend, % Value . "=" . %Value% . "`n", % SaveFile.txt