dpmancus Posted May 13, 2010 Share Posted May 13, 2010 (edited) hi everybody,got a problem with array definition:here's my array definition$s[1] = "qwerty"on running i reiceve an error:Line 13 (File "C:\Documents and Settings\Antony\Documenti\AutoIT prove\Nuovo AutoIt v3 Script (2).au3"):$s[1] = "qwerty"$s^ ERRORError: Expected a "=" operator in assignment statement.where is my mistakes?????thanks Edited May 13, 2010 by dpmancus Link to comment Share on other sites More sharing options...
l3ill Posted May 13, 2010 Share Posted May 13, 2010 Line 13 (File "C:\Documents and Settings\Antony\Documenti\AutoIT prove\Nuovo AutoIt v3 Script (2).au3"):where is my mistakes?????In line 13 of the code we cant see ;-) My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 13, 2010 Share Posted May 13, 2010 (edited) ; 1D Arrays: Global $s[1] = ["qwerty"] Global $t[2] = ["qwerty", "dvorak"] ;2D Array: Global $u[2][2] = [["0/0", "0/1"], ["1/0", "1/1"]] ; 3D Array: Global $v[2][2][3] = [[["0/0/0", "0/0/1", "0/0/2"], ["0/1/0", "0/1/1", "0/1/2"]], [["1/0/0", "1/0/1", "1/0/2"], ["1/1/0", "1/1/1", "1/1/2"]]] Edit: Forgot variable declaration keyword (Dim/Local/Global). This syntax for initializing the array is only valid when the array is declared. Edited May 13, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
dpmancus Posted May 13, 2010 Author Share Posted May 13, 2010 s[1] = "qwerty" is line n°13 Link to comment Share on other sites More sharing options...
dpmancus Posted May 13, 2010 Author Share Posted May 13, 2010 ; 1D Arrays: $s[1] = ["qwerty"] $t[2] = ["qwerty", "dvorak"] ;2D Array: $u[2][2] = [["0/0", "0/1"], ["1/0", "1/1"]] ; 3D Array: $v[2][2][3] = [[["0/0/0", "0/0/1", "0/0/2"], ["0/1/0", "0/1/1", "0/1/2"]], [["1/0/0", "1/0/1", "1/0/2"], ["1/1/0", "1/1/1", "1/1/2"]]] thanks a lot... i'll try this way Link to comment Share on other sites More sharing options...
Malkey Posted May 13, 2010 Share Posted May 13, 2010 This script when run, does not create any errors. Local $s[2] $s[1] = "qwerty" ;============================== ; 1D Arrays: Local $s[1] = ["qwerty"] Global $t[2] = ["qwerty", "dvorak"] ;2D Array: Dim $u[2][2] = [["0/0", "0/1"],["1/0", "1/1"]] ; 3D Array: Local $v[2][2][3] = [[["0/0/0", "0/0/1", "0/0/2"],["0/1/0", "0/1/1", "0/1/2"]],[["1/0/0", "1/0/1", "1/0/2"],["1/1/0", "1/1/1", "1/1/2"]]] Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 13, 2010 Share Posted May 13, 2010 This script when run, does not create any errors.Oops. I forgot the declaration keywords. Fixed in original post. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
dpmancus Posted May 13, 2010 Author Share Posted May 13, 2010 thanks... now it's ok i was forgetting "Dim $s[2]"!!!! got to study more 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