Keltset Posted November 11, 2009 Share Posted November 11, 2009 I really need help, I cannot seem to figure this out... I wrote code that takes a 1d array data and stores it as a string into an ini under a key. And the ini looks like this: [MessageBoxes] FreeGifts_Size=6 FreeGifts_Color=0x6D84B4, 0x6D84B4, 0x6D84B4, 0x6D84B4, 0x6D84B4, 0x6D84B4 FreeGifts_Variance=3, 3, 3, 3, 3, 3 Im trying to turn these into two arrays: $section = "MessageBoxes" $name = "FreeGifts" $test1[IniRead("fv.ini", $section, $name&"_Size", "fail")] = [IniRead("fv.ini", $section, $name&"_Color", "fail")] $test2[IniRead("fv.ini", $section, $name&"_Size", "fail")] = [IniRead("fv.ini", $section, $name&"_Variance", "fail")] I run this and I keep getting syntax errors... : ERROR: syntax error $test1[iniRead("fv.ini", $section, $name&"_Size", "fail")] = [ I thought you could declare an array by doing $array[$size] = [stuff,to,match,size]?? *Confused* Can someone please tell me what the heck I'm doing wrong? -K Link to comment Share on other sites More sharing options...
Achilles Posted November 11, 2009 Share Posted November 11, 2009 Here's a simpler way of doing it: #include <Array.au3> $colors = IniRead(@ScriptDir & '\temp.ini', 'MessageBoxes', 'FreeGifts_color', '-1') If $colors <> '-1' then $colors = StringSplit($colors, ',') EndIf $variance = IniRead(@ScriptDir & '\temp.ini', 'MessageBoxes', 'FreeGifts_Variance', '-1') If $variance <> '-1' then $variance = StringSplit($variance, ',') EndIf _ArrayDisplay($colors, '$colors') _ArrayDisplay($variance, '$variance')You will have to change the position of the .ini file. Ask if you don't understand how any of this works. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Keltset Posted November 12, 2009 Author Share Posted November 12, 2009 Thank you, this resolves my problem!!! -K 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