anixon Posted June 22, 2008 Share Posted June 22, 2008 This code is to perform multiple reads of an INI file [3 in this example but it could be 33 or any other number for that matter] #include <string.au3> Const $ScriptDir = @ScriptDir & "\test.ini" Global $BeepNum = "", $PingID1 = "", $PingID2 = "" Global $LData[3] = ["$BeepNum|Section1|value|4", "$PingID1|Section2|value|0", "$PingID2|Section3|value|0"]] For $i = 0 To UBound($LData) - 1 $LICENCEData = _StringSplit($LData[$i], "|") $INIRead = IniRead($ScriptDir,$LICENCEData[1],$LICENCEData[2],$LICENCEData[3]) If $LICENCEData[0] = "$BeepNum" then $BeepNum = $INIRead If $LICENCEData[0] = "$PingID1" then $PingID1 = $INIRead If $LICENCEData[0] = "$PingID2" then $PingID2 = $INIRead Next Exit Whilst it works how do I assign the INI file value for $BeepNum, $PingID1 and $PingID2 for as many items as there might be without having to use an individual IF statements to assign the INI value to each variable. Ant.. Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 22, 2008 Share Posted June 22, 2008 Assign($LICENCEData[0], $INIRead) Link to comment Share on other sites More sharing options...
anixon Posted June 22, 2008 Author Share Posted June 22, 2008 Assign($LICENCEData[0], $INIRead) RR another Kentucky winner..... Thanks for your help tis much appreciated keep Ant.. [Melbourne Cup Territory] Link to comment Share on other sites More sharing options...
rover Posted June 22, 2008 Share Posted June 22, 2008 Assign(StringTrimLeft($LICENCEData[0], 1), $INIRead) or dont use '$' for vars in array I see fascists... Link to comment Share on other sites More sharing options...
anixon Posted June 22, 2008 Author Share Posted June 22, 2008 Assign(StringTrimLeft($LICENCEData[0], 1), $INIRead) or don't use '$' for var names in array Thanks for that as you have pointed out you indeed to not need to us '$' in the array. Ant.. Link to comment Share on other sites More sharing options...
rover Posted June 22, 2008 Share Posted June 22, 2008 Thanks for that as you have pointed out you indeed to not need to us '$' in the array. Ant.. I should have noted the time before posting. server went down momentarily causing duplicate posts.every now and then if I'm on the forum around 8AM GMT (3AM where I am)the site gives internal server errors and wont load pages or process posts.down for maintenance routines I assume. I see fascists... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now