BrettF 28 Posted September 29, 2007 Ok... I tried this in response to Jakits' Question about multiple message boxes as a quick example, yet I get an error, which I can't seem to work out in any shape or form why I get it...The Offending Code:#include <GUIConstants.au3> Dim $gui Dim $txt Dim $btn_ok For $i = 1 To 10 $gui[$i] = GUICreate("Title: " & $i, 260, 95, 195, 115, $WS_SYSMENU+$WS_CAPTION+$WS_POPUPWINDOW+$WS_BORDER+$WS_CLIPSIBLINGS) $txt[$i] = GUICtrlCreateLabel("txt", 8, 4, 247, 53) $btn_ok[$i] = GUICtrlCreateButton("Ok", 92, 64, 75, 25, 0) GUISetState(@SW_SHOW, $gui[$i]) Next While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $GUI_EVENT_CLOSE Or $msg[0] = $btn_ok GUIDelete($gui[$msg[1]]) EndSelect WEndThe Error:>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "d:\my documents\My Files\My Stuff\help.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams +>15:44:58 Starting AutoIt3Wrapper v.1.9.2 >Running AU3Check (1.54.9.0) from:C:\Program Files\AutoIt3 +>15:44:58 AU3Check ended.rc:0 >Running:(3.2.6.0):C:\Program Files\AutoIt3\autoit3.exe "d:\my documents\My Files\My Stuff\help.au3" D:\My Documents\My Files\My Stuff\help.au3 (8) : ==> Expected a "=" operator in assignment statement.: $gui[$i] = GUICreate("Title: " & $i, 260, 95, 195, 115, $WS_SYSMENU+$WS_CAPTION+$WS_POPUPWINDOW+$WS_BORDER+$WS_CLIPSIBLINGS) ->15:44:59 AutoIT3.exe ended.rc:1 +>15:44:59 AutoIt3Wrapper Finished >Exit code: 1 Time: 1.756Thanks for the help... 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! Share this post Link to post Share on other sites
Valuater 130 Posted September 29, 2007 One way... #include <GUIConstants.au3> Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to - Dim $gui[11] Dim $txt[11] Dim $btn_ok[11] For $i = 1 To 10 $gui[$i] = GUICreate("Title: " & $i, 260, 95, 195 + $i, 115 + $i);, $WS_SYSMENU+$WS_CAPTION+$WS_POPUPWINDOW+$WS_BORDER+$WS_CLIPSIBLINGS) $txt[$i] = GUICtrlCreateLabel("txt", 8, 4, 247, 53) $btn_ok[$i] = GUICtrlCreateButton("Ok", 92, 64, 75, 25, 0) GUISetState(@SW_SHOW) Next While 1 $msg = GUIGetMsg() for $x = 1 to 10 If $msg = $btn_ok[$x] Then If $msg = $btn_ok[1] Then Exit MsgBox(0x0,"button pressed", "number " & $x, 3) GUIDelete($gui[$x]) EndIf Next WEnd 8) Share this post Link to post Share on other sites
Jos 2,275 Posted September 29, 2007 (edited) its these that are wrong: Dim $gui Dim $txt Dim $btn_ok Should be this as Valuater pointed out: Dim $gui[11] Dim $txt[11] Dim $btn_ok[11] Edited September 29, 2007 by Jos spelling SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
BrettF 28 Posted September 29, 2007 its these that are wrong: Dim $gui Dim $txt Dim $btn_ok Should be this as Valuater poited out: Dim $gui[11] Dim $txt[11] Dim $btn_ok[11]Ok 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! Share this post Link to post Share on other sites