dpmancus Posted May 13, 2010 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
l3ill Posted May 13, 2010 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
PsaltyDS Posted May 13, 2010 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
dpmancus Posted May 13, 2010 Author 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
Malkey Posted May 13, 2010 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"]]]
PsaltyDS Posted May 13, 2010 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
dpmancus Posted May 13, 2010 Author Posted May 13, 2010 thanks... now it's ok i was forgetting "Dim $s[2]"!!!! got to study more
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