Ram Posted January 15, 2007 Posted January 15, 2007 (edited) This sounds simple stuff...but I am new to this scripting stuff..!! This is what I am trying to do .. $a1 = "a" $a2 = "b" $a3 = "c" $a4 = "d" For $a = 1 TO 4 MsgBox (0, "Test", $a) Next actually I am trying to get the value for a1,a2,a3,a4 in the message box but the above script gives the value 1,2,3,4... can you recorrect the above code to get the values!! Awaiting your response! Thanks! Edited January 15, 2007 by Ram
Zedna Posted January 15, 2007 Posted January 15, 2007 For $a1 = 1 TO 4 MsgBox (0, "Test", Chr($a1 + 96)) Next Resources UDF ResourcesEx UDF AutoIt Forum Search
xcal Posted January 15, 2007 Posted January 15, 2007 Jump right in to learning arrays. Arrays and loops are your best friend. Dim $array[5] = [4, 'a', 'b', 'c', 'd'] For $i = 1 To $array[0] MsgBox(0, "Test", $array[$i]) Next How To Ask Questions The Smart Way
Ram Posted January 15, 2007 Author Posted January 15, 2007 (edited) For $a1 = 1 TO 4 MsgBox (0, "Test", Chr($a1 + 96)) Next Thanks.. but this is not the one that I am looking for..!! I have different variables and values to it.. say $a1 = "RAM" $a2 = "2" $a3 = "Kumar" $a4 = "Singh" I want to put a for loop that reads the variable a1,a2,a3,a4 and then put them in the message box one by one..!! So how do i go about doing that? Edited January 15, 2007 by Ram
BrettF Posted January 15, 2007 Posted January 15, 2007 So like Msgbox 1 has $a1 = "RAM" And Msg Box 2 has $a1 = "RAM" and $a2 = "2" And Msg box 3 has...... Is that what you want??? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Ram Posted January 15, 2007 Author Posted January 15, 2007 So likeMsgbox 1 has $a1 = "RAM"And Msg Box 2 has $a1 = "RAM" and $a2 = "2"And Msg box 3 has......Is that what you want???similar like that but if Msgbox 1 has $a1 = "RAM" Msgbox 2 should have $a2 = "2" Msgbox 3 should have $a3 = "Kumar"and so on..
BrettF Posted January 15, 2007 Posted January 15, 2007 Did you even look at xcal's code?? Thats what his does. Cange 'a' to Ram and so on.... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Ram Posted January 15, 2007 Author Posted January 15, 2007 Jump right in to learning arrays. Arrays and loops are your best friend. Dim $array[5] = [4, 'a', 'b', 'c', 'd'] For $i = 1 To $array[0] MsgBox(0, "Test", $array[$i]) Next Ooops.. I missed your code.. Thanks for the eg. thisis what I was looking for... i will go ahead look at the array help file..!! Thanks!
Ram Posted January 15, 2007 Author Posted January 15, 2007 Did you even look at xcal's code?? Thats what his does.Cange 'a' to Ram and so on.... Just replied to him.. Thanks!
BALA Posted January 15, 2007 Posted January 15, 2007 How about having a while loop? EXAMPLE: $num = 1 $a1 = "a" $a2 = "b" $a3 = "c" $a4 = "d" While 1 MsgBox (0, "Test", $a & $num) $num = $num + 1 If $num > 4 ExitLoop EndIf WEnd [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
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