rawrr Posted February 27, 2008 Share Posted February 27, 2008 So far this is my code..expandcollapse popup#include <GUIConstants.au3> $GUI = GUICreate("QLPS", 150, 180, -1, -1); this creates the Box and the title in the blue bar $realm = GUICtrlCreateInput("texthere", 10, 90, 130, 20); Imput box (fool around with the numbers to change size) $patch = GUICtrlCreateInput("texthere", 10, 140 , 130, 20) $set = GUICtrlCreateButton("SET", 10, 50, 130, 25); The Button GUISetState() While 1 Switch GUIGetMsg() Case - 3 Exit Case $set $set = _createchild() $set = guictrlcreateinput("Name Here", 10, 140, 130, 20) Func _CreateChild() Opt("TrayMenuMode",1) GUISetState(@SW_DISABLE,$GUI) $Child=GUICreate("Set",150,80,-1,-1,-1,-1,$GUI) $Namebox = GUICTRLCREATEINPUT("NAME", 10, 50, 130, 20) $save = GUICTRLCREATEBUTTON("SAVE", 45, 15, 60, 30) $save = traycreateitem (GUICTRLREAD ($namebox)) traycreateitem () GUISetState() traysetstate() while 1 Switch GUIGetMsg() Case - 3 Exit While 1 $msg1 = GUIGetMsg() Switch $msg1 Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($Child) GUISetState(@SW_ENABLE,$GUI) ReturnNow I am trying to make it so when save (the save button) is clicked it makes a tray icon with the name that is in the input box (namebox) Idk if it right but I got this error, What do I do? Link to comment Share on other sites More sharing options...
Developers Jos Posted February 27, 2008 Developers Share Posted February 27, 2008 (edited) This is the Tidy output which tells you about your problem(s): expandcollapse popup#Tidy_Parameters=/rel 1 #include <GUIConstants.au3> $GUI = GUICreate("QLPS", 150, 180, -1, -1); this creates the Box and the title in the blue bar $realm = GUICtrlCreateInput("texthere", 10, 90, 130, 20); Imput box (fool around with the numbers to change size) $patch = GUICtrlCreateInput("texthere", 10, 140, 130, 20) $set = GUICtrlCreateButton("SET", 10, 50, 130, 25); The Button GUISetState() While 1 Switch GUIGetMsg() Case - 3 Exit Case $set $set = _CreateChild() $set = GUICtrlCreateInput("Name Here", 10, 140, 130, 20) ;### Tidy Error -> case Not closed before "Func" statement. ;### Tidy Error -> "Func" cannot be inside any IF/Do/While/For/Case/Func statement. Func _CreateChild() Opt("TrayMenuMode", 1) GUISetState(@SW_DISABLE, $GUI) $Child = GUICreate("Set", 150, 80, -1, -1, -1, -1, $GUI) $Namebox = GUICtrlCreateInput("NAME", 10, 50, 130, 20) $save = GUICtrlCreateButton("SAVE", 45, 15, 60, 30) $save = TrayCreateItem(GUICtrlRead($Namebox)) TrayCreateItem() GUISetState() TraySetState() While 1 Switch GUIGetMsg() Case - 3 Exit While 1 $msg1 = GUIGetMsg() Switch $msg1 Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($Child) GUISetState(@SW_ENABLE, $GUI) Return Edited February 27, 2008 by Jos 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. Link to comment Share on other sites More sharing options...
rawrr Posted February 27, 2008 Author Share Posted February 27, 2008 (edited) Thanks, but I still don't understand? I am still for the most part new. Edited February 27, 2008 by rawrr Link to comment Share on other sites More sharing options...
Developers Jos Posted February 27, 2008 Developers Share Posted February 27, 2008 ;### Tidy Error -> "Func" cannot be inside any IF/Do/While/For/Case/Func statement. You cannot have a func...endfunc statement inside a loop or if and needs to be on its own. Check the helpfile for examples. 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. Link to comment Share on other sites More sharing options...
rawrr Posted February 27, 2008 Author Share Posted February 27, 2008 Lol sorry, but I am so lost right now.. =[ Link to comment Share on other sites More sharing options...
Developers Jos Posted February 27, 2008 Developers Share Posted February 27, 2008 (edited) Lol sorry, but I am so lost right now.. =[Its your code so you should be know what you are doing.. right ? How can anybody really help when you post a snippet that contains the error but we have no idea what it is that needs to be accomplished. I explained the error you have and tidy - ed your code so you can see where your errors are in respect to the Func and the none closed While and Select statements. Jos Edited February 27, 2008 by Jos 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. Link to comment Share on other sites More sharing options...
rawrr Posted February 27, 2008 Author Share Posted February 27, 2008 (edited) I looked everything over I don't know what to fix.. expandcollapse popup#Tidy_Parameters=/rel 1 #include <GUIConstants.au3> $GUI = GUICreate("QLPS", 150, 180, -1, -1); this creates the Box and the title in the blue bar $realm = GUICtrlCreateInput("texthere", 10, 90, 130, 20); Imput box (fool around with the numbers to change size) $patch = GUICtrlCreateInput("texthere", 10, 140, 130, 20) $set = GUICtrlCreateButton("SET", 10, 50, 130, 25); The Button GUISetState() While 1 Switch GUIGetMsg() Case - 3 Exit Case $set $set = _CreateChild() $set = GUICtrlCreateInput("Name Here", 10, 140, 130, 20) ExitLoop EndSwitch WEnd ;### Tidy Error -> case Not closed before "Func" statement. ;### Tidy Error -> "Func" cannot be inside any IF/Do/While/For/Case/Func statement. Func _CreateChild() Opt("TrayMenuMode", 1) GUISetState(@SW_DISABLE, $GUI) $Child = GUICreate("Set", 150, 80, -1, -1, -1, -1, $GUI) $Namebox = GUICtrlCreateInput("NAME", 10, 50, 130, 20) $save = GUICtrlCreateButton("SAVE", 45, 15, 60, 30) $save = TrayCreateItem(GUICtrlRead($Namebox)) TrayCreateItem() GUISetState() TraySetState() endfunc While 1 Switch GUIGetMsg() Case - 3 Exit While 1 $msg1 = GUIGetMsg() Switch $msg1 Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($Child) GUISetState(@SW_ENABLE, $GUI) Return my new one? still return error Edited February 27, 2008 by rawrr Link to comment Share on other sites More sharing options...
rawrr Posted February 28, 2008 Author Share Posted February 28, 2008 Bump? I still need help. =[ Link to comment Share on other sites More sharing options...
GaryFrost Posted February 28, 2008 Share Posted February 28, 2008 Bump? I still need help. =[ remove the function out of the while loop as you've been told. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
rasim Posted February 29, 2008 Share Posted February 29, 2008 rawwrYour code have a many errors and difficult to read. You need this?:expandcollapse popup#NoTrayIcon #include <GUIConstants.au3> Opt("TrayMenuMode", 1) ;Main GUI $GUI = GUICreate("QLPS", 150, 180, -1, -1); this creates the Box and the title in the blue bar $realm = GUICtrlCreateInput("texthere", 10, 90, 130, 20); Imput box (fool around with the numbers to change size) $patch = GUICtrlCreateInput("texthere", 10, 140, 130, 20) $set = GUICtrlCreateButton("SET", 10, 50, 130, 25); The Button ;Child GUI $Child = GUICreate("Set", 150, 80, -1, -1, -1, -1, $GUI) $Namebox = GUICtrlCreateInput("NAME", 10, 50, 130, 20) $saveButton = GUICtrlCreateButton("SAVE", 45, 15, 60, 30) $saveTray = TrayCreateItem(GUICtrlRead($Namebox)) TrayCreateItem("") GUISetState(@SW_SHOW, $GUI) While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $GUI ExitLoop Case ($msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $Child) Or ($msg[0] = $saveButton And $msg[1] = $Child) GUISetState(@SW_ENABLE, $GUI) GUISetState(@SW_HIDE, $Child) TraySetState(2) Case $msg[0] = $set GUISetState(@SW_DISABLE, $GUI) GUISetState(@SW_SHOW, $Child) TraySetState(1 + 4) EndSelect WEnd P.S. Learn to write code a readability. Link to comment Share on other sites More sharing options...
rawrr Posted February 29, 2008 Author Share Posted February 29, 2008 Thanks. I was never neat. But I did get the return error out! =] Link to comment Share on other sites More sharing options...
rasim Posted March 1, 2008 Share Posted March 1, 2008 But I did get the return error out! =]What? Where? Link to comment Share on other sites More sharing options...
BrettF Posted March 1, 2008 Share Posted March 1, 2008 What? Where? From what I gather, it worked and the was no error. Hard to understand, I know... 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! 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