GameIDevelp Posted March 8, 2009 Posted March 8, 2009 How to Change "$change" results , with array "$pr[0]" and "$pr[1]" - - - $pr[5] every time when the loop ...? I have this code ..... Dim $pr[5] $pr[0] = "cccc" $pr[1] = "dddd" $pr[2] = "eeee" $pr[3] = "artt" $pr[4] = "huge" $loop = 1 $var1 = 0 While $loop = 1 $var1 = $var1 + 1 $change = $pr[0] If $var1 = 1 Then MsgBox(0, "ms", $change) Else MsgBox(0, "ms", "not1") If $var1 = 2 Then MsgBox(0, "msg", "ok-2") Else MsgBox(0, "ms", "not2") EndIf EndIf $loop = 1 WEnd
FireFox Posted March 8, 2009 Posted March 8, 2009 @GameIDevelp I dont understand you $change = $pr[0+$loop]oÝ÷ Ù«¢+ØÀÌØí¡¹ôÀÌØíÁÈ()%ÀÌØíÙÈÄôÄQ¡¸(½ÈÀÌØí¤ôÄѼU ½Õ¹ ÀÌØíÁȤ´Ä(5Í ½à À°ÅÕ½ÐíµÌÅÕ½Ðì°ÀÌØí¡¹¤(9áÐ)¹% Hope that helps Cheers, FireFox.
GameIDevelp Posted March 8, 2009 Author Posted March 8, 2009 the $change results is "ccc" from $pr[0] ,, I make this var "$change for me to understand the change value var to another value var . I hop you understand .. The code not work ,, return just 1 ,2 ,3 ,4 , not value of $pr[0] , $pr[1] etc --- $pr[5] ...
FireFox Posted March 8, 2009 Posted March 8, 2009 can you exaplain each line of your code ? Local $pr[5] $pr[0] = "cccc" $pr[1] = "dddd" $pr[2] = "eeee" $pr[3] = "artt" $pr[4] = "huge" $loop = 1 $var1 = 0 While $loop < 5; While $loop = 1 $var1 += 1; $var1 = $var1 + 1 $change = $pr[0]; "cccc" If $var1 = 1 Then MsgBox(0, "ms", $pr[$i]); $change) Else MsgBox(0, "ms", "not1") If $var1 = 2 Then MsgBox(0, "msg", "ok-2") Else MsgBox(0, "ms", "not2") EndIf EndIf $loop += 1 WEnd Cheers, FireFox.
GameIDevelp Posted March 9, 2009 Author Posted March 9, 2009 can you exaplain each line of your code ? Local $pr[5] $pr[0] = "cccc" $pr[1] = "dddd" $pr[2] = "eeee" $pr[3] = "artt" $pr[4] = "huge" $loop = 1 $var1 = 0 While $loop < 5; While $loop = 1 $var1 += 1; $var1 = $var1 + 1 $change = $pr[0]; "cccc" If $var1 = 1 Then MsgBox(0, "ms", $pr[$i]); $change) Else MsgBox(0, "ms", "not1") If $var1 = 2 Then MsgBox(0, "msg", "ok-2") Else MsgBox(0, "ms", "not2") EndIf EndIf $loop += 1 WEnd Cheers, FireFox. Your code is not displayed corectly .. I wont to make this variable "$change" to change every time when the loop code to change into the 1 value of variable $pr ,, When Loop 1 the I wont to change value of variable "$change" into the value of variable "$pr[0] ,,,,, and for loop 2 change $change to $pr[1] and next next next and again ..
Gondus Posted March 9, 2009 Posted March 9, 2009 (edited) Edit: You could change all the $i to $var1 if you wanted to..basically that one $i was messing you up. Edit2: Meh code tags (use his version below (less to write and easier to use). Local $pr[5] $pr[0] = "cccc" $pr[1] = "dddd" $pr[2] = "eeee" $pr[3] = "artt" $pr[4] = "huge" $i = 0 $loop = 1 While $loop < 5; While $loop = 1 $i += 1; $var1 = $var1 + 1 $change = $pr[0]; "cccc" If $i = 1 Then MsgBox(0, "ms", $pr[$i]); $change) Else MsgBox(0, "ms", "not1") If $i = 2 Then MsgBox(0, "msg", "ok-2") Else MsgBox(0, "ms", "not2") EndIf EndIf $loop += 1 WEnd Edited March 9, 2009 by Gondus -----------Current Programming Language Status:Beginner: J#, Ruby Intermediate: Autoit, Java, C#, C++Advanced: Basic, Visual Basic, Fortran
AdmiralAlkex Posted March 9, 2009 Posted March 9, 2009 Your code is not displayed corectly .. I wont to make this variable "$change" to change every time when the loop code to change into the 1 value of variable $pr ,, When Loop 1 the I wont to change value of variable "$change" into the value of variable "$pr[0] ,,,,, and for loop 2 change $change to $pr[1] and next next next and again ..You normally use For-loops for that kind of thing, like in Firefox first post. Here is another example: Local $pr[5] $pr[0] = "cccc" $pr[1] = "dddd" $pr[2] = "eeee" $pr[3] = "artt" $pr[4] = "huge" For $X = 0 To 4 $change = $pr[$X] MsgBox(0, "", $change) Next .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
GameIDevelp Posted March 9, 2009 Author Posted March 9, 2009 wooo ,,,, thanks guys . . Sorry for my misunderstanding I dont know very good autoit ..
Gondus Posted March 9, 2009 Posted March 9, 2009 wooo ,,,, thanks guys . .Sorry for my misunderstanding I dont know very good autoit ..Thats why this forums is here -----------Current Programming Language Status:Beginner: J#, Ruby Intermediate: Autoit, Java, C#, C++Advanced: Basic, Visual Basic, Fortran
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