kcd-clan Posted May 4, 2006 Share Posted May 4, 2006 Ok i need to do this Create a array like this $n[$i]= " " Well read the script you will see waht i wanan do.. For $i=0 To $i=$x_val $i+1 Dim $x_val[$i]=" " Next Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone() Link to comment Share on other sites More sharing options...
MadBoy Posted May 4, 2006 Share Posted May 4, 2006 For $i=0 To $i=$x_val Dim $x_val[$i]=" " Next Should work.. My little company: Evotec (PL version: Evotec) Link to comment Share on other sites More sharing options...
greenmachine Posted May 4, 2006 Share Posted May 4, 2006 There's no need for the Dim inside the loop - that tries to recreate the array each time. What are you trying to do exactly? Where did $x_val come from? Why are you trying to turn an integer into an array? Link to comment Share on other sites More sharing options...
kcd-clan Posted May 4, 2006 Author Share Posted May 4, 2006 (edited) D:\desk\autoit\pong\main.au3 (14) : ==> Expected a "=" operator in assignment statement.: $x_val[$i] = " " ; Varables Global $x_val=75 Global $y_val=75 Global $x_offset=0 Global $y_offset=0 Global $i=0 ; Inclusion #include <Array.au3> ; Main Functions Func setboard() For $i=0 To $i=$x_val $x_val[$i] = " " If $i = 20 Then $i = "O" $out = $x_val[$i] Next ToolTip($out,$x_offset,$y_offset) EndFunc Edited May 4, 2006 by kcd-clan Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone() Link to comment Share on other sites More sharing options...
Valuater Posted May 4, 2006 Share Posted May 4, 2006 (edited) maybe ; Inclusion #include <Array.au3> ; Varables Global $x_va1[21] Global $x_val = 75 Global $y_val = 75 Global $x_offset = 0 Global $y_offset = 0 Global $i = 0 ; Main Functions Func setboard() For $i = 0 To $x_val $x_va1[$i] = " " If $i = 20 Then $i = "O" $out = $x_va1[$i] ToolTip($out, $x_offset, $y_offset) Next EndFunc ;==>setboard 8) Edited May 4, 2006 by Valuater Link to comment Share on other sites More sharing options...
greenmachine Posted May 4, 2006 Share Posted May 4, 2006 Uhh, you can't have an int variable and an array with the same name. Rename your variables to be unique and you'll be ok. Link to comment Share on other sites More sharing options...
nfwu Posted May 4, 2006 Share Posted May 4, 2006 (edited) Sorry to butt in, but Global $x_va1[21] Global $x_val = 75 ^^ They are not the same though they look the same.. The first one has the number one (1) at the end while the other has the letter "l" #) edit: Typo (that>has) Edited May 4, 2006 by nfwu TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
greenmachine Posted May 4, 2006 Share Posted May 4, 2006 Sorry to butt in, but Global $x_va1[21] Global $x_val = 75 ^^ They are not the same though they look the same.. The first one has the number one (1) at the end while the other has the letter "l" #) edit: Typo (that>has) They REALLY look the same. Still, that's some ugly code for more than just that reason. If you set $i to be something while it's looping, the loop never ends. If it were to get past the part where $i is set to o, then it would be out of bounds because $x_val is 75 and the max index of $x_va1 is 20.... I'm starting to think I really don't know what's going on here - the code isn't really understandable and I still can't tell what he's trying to do. Link to comment Share on other sites More sharing options...
nfwu Posted May 4, 2006 Share Posted May 4, 2006 err... good point... Now, logically looking at the code, i don't understand a thing... #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Valuater Posted May 4, 2006 Share Posted May 4, 2006 neither did i guys.... i just fixed his syntax errors only 8) 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