peterj04 Posted January 15, 2010 Share Posted January 15, 2010 Hello, another new user here with basically zero scripting experience and looking for help. What I would like to do is have an Input Box that if the user clicks "No" it will go back to my "DVB1" input box and ask them to reenter the IP address. I'm pretty sure I need to create a function or loop (or something else), but I don't know what. I've tried to experiment with the different options, but can't figure it out. If someone could at least tell me if I need to create an array or tell me what function or whatever it might be to get me going in the right direction it would be greatly appreciated, I should be able to figure it out from there. Here is currently what I have and works if the user doesn't make a mistake and clicks "Yes" on the message box : Dim $msg1, $DVB1 $DVB1 = InputBox('DVB1', 'Enter the IP address for DVB1') Sleep(500) $msg1 = msgbox(3, "DVB1", "Is this correct? " & $DVB1) If $msg1 = True Then Sleep(1000) Send($DVB1) EndIf Link to comment Share on other sites More sharing options...
FuryCell Posted January 15, 2010 Share Posted January 15, 2010 Maybe something like this? Dim $msg1, $DVB1 While 1 $DVB1 = InputBox('DVB1', 'Enter the IP address for DVB1') Sleep(500) $msg1 = MsgBox(3, "DVB1", "Is this correct? " & $DVB1) If $msg1 <> 7 Then ExitLoop WEnd Sleep(1000) Send($DVB1) HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 15, 2010 Moderators Share Posted January 15, 2010 peterj04, Welcome to the AutoIt forum. Take a look at this: Dim $DVB1 While 1 $DVB1 = InputBox('DVB1', 'Enter the IP address for DVB1') ; check if anything was actually entered If $DVB1 <> "" Then ; what button was pressed? Switch msgbox(3, "DVB1", "Is this correct? " & $DVB1) Case 6 ; yes Sleep(1000) Send($DVB1) ; and leave the loop to carry on below ExitLoop Case 7 ; no ; try again Case 2 ; cancel ; give up Exit EndSwitch EndIf WEnd ; pressing Yes will get you to here Please ask if anything is unclear. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
peterj04 Posted January 15, 2010 Author Share Posted January 15, 2010 Wow thanks for the quick responses. I tried the code you gave me Melba and it works great! 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