symadis Posted November 13, 2007 Share Posted November 13, 2007 Hello! I have made a script that's working fine. At the begining of my script i have put somes options like $test = 1014 $prod = 1013 $mode = $prodoÝ÷ Û]5Ý©©×Mxj·¢{k¢Rçèè¥jéÜl¬r¸©¶'!jx©îjYrÓ~¦¡×£ZµëÞ®,Ý7ê׬¶ôߪk¡Öî¶,Ûhr(±ëa{Mú^½©nz)Ú謢+k˪i«¢+Ø¥¹±Õ±ÐíU% ½¹ÍѹÑ̹ÔÌÐì((I¥½¸MQIP-½U$ÍÑ¥½¸½É´ô(ÀÌØí½É´ÈôU% ÉÑ ÅÕ½Ðí½É´ÄÅÕ½Ðì°ÄäØ°ÄÔÀ°ÐàÀ°ÈÌܤ(ÀÌØíµ½ôU% Ñɱ ÉÑ ½µ¼ ÅÕ½ÐìÅÕ½Ðì°ÌÈ°ÈаàÄ°ÈÔ¤)U% ÑɱMÑÑ ´Ä°ÅÕ½ÐíQÍÑñAɽÕÑ¥½¸ÅÕ½Ðì°ÅÕ½ÐíAɽÕÑ¥½¸ÅÕ½Ðì¤)U%MÑMÑÑ¡M]}M!=¤(¹I¥½¸9-½U$ÍÑ¥½¸()]¡¥±Ä($ÀÌØí¹5ÍôU%Ñ5Í ¤(%MÝ¥Ñ ÀÌØí¹5Í($% ÍÀÌØíU%}Y9Q} 1=M($$%á¥Ð((%¹MÝ¥Ñ )]¹ My question are: - WHERE DO I PUT THE ENTIRE SCRIPT IN THE GUI SCRIPT? In the While 1 or after? - How can i get $mode's value to see if it's working - Can we use a label and value like in html ? (label : Test, value : 1014 ....) <select name="mode" id="mode"> <option value="1014">Test</option> <option value="1013">Production</option> </select> Thank you for your help, Loris Link to comment Share on other sites More sharing options...
BrettF Posted November 13, 2007 Share Posted November 13, 2007 (edited) Read the control, then test the values. So, if $value = "Test" Then $mode = $test Else $mode = $prod. Something like that... It will have to be a case. Or, put into the exit func. So Read the values into a varible, exitloop, then GUIDelete. Then you can continue with the rest of the code. This snippet should be put it at the top of your script, bellow the includes. You should map your script out like this (How I would do it): #compiler_ directives #includes Options Hotkeys Declaring Varible/Const GUI Control Code Code that is needed for the GUI to be as you want it. i.e- populating a combo with your data from an ini. While loop Functions Edited November 13, 2007 by Bert 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...
symadis Posted November 13, 2007 Author Share Posted November 13, 2007 Thank you for your fast reply, I'm going to check this. Thank you a lot! Link to comment Share on other sites More sharing options...
Zedna Posted November 13, 2007 Share Posted November 13, 2007 #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Form1", 196, 150, 480, 237) $mode = GUICtrlCreateCombo("", 32, 24, 81, 25) GUICtrlSetData(-1, "Test|Production", "Production") $ok = GUICtrlCreateButton("OK", 32, 70, 81, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ok DoMyStuff() EndSwitch WEnd Func DoMyStuff() ; note: read values from GUI before delete GUI $value = GUICtrlRead($mode) GUIDelete($Form2) ; here is your script, do something with value ... MsgBox(0,'result', $value) Exit EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search 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