Jump to content



Photo

Msgbox loop question


  • Please log in to reply
4 replies to this topic

#1 Nemon

Nemon

    Seeker

  • Active Members
  • 11 posts

Posted 09 August 2012 - 03:48 PM

I'm so mad I can't figure this out!

I've been looking over the fourm archives for ever and it could be that it is so simple no one talks about it.

Here is what I need:

$num = InputBox("Number", "What is the number? ", "", "")
if $num = "" Then Exit
WinActivate("window")
Send($012num)

$msg = MsgBox(36, "correct?", "Was the number input correctly")
If = $msg = 7 Then
:::loops back to the input box until:::
Else $msg = 6 Then
;;;;;The rest of the script keeps going;;;;

Is this possible to do?

Thanks
Sigh







#2 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,391 posts

Posted 09 August 2012 - 03:54 PM

Nemon,

Put the whole thing in an infinite loop - if the number is correct then use ExitLoop to break out. ;)

M23
StringSize - Automatically size controls to fit text - ExtMsgBox - A user customisable replacement for MsgBox

Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs

Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames

GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes

ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display

RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options

GUIListViewEx - Insert, delete, move, drag and sort ListView items


#3 water

water

    ?

  • MVPs
  • 10,696 posts

Posted 09 August 2012 - 03:57 PM

Try it in a loop:
Global $msg = 0 While $msg <> 6     $msg = MsgBox(36, "correct?", "Was the number input correctly") WEnd ;;;;;The rest of the script keeps going;;;;

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#4 Nemon

Nemon

    Seeker

  • Active Members
  • 11 posts

Posted 09 August 2012 - 04:13 PM

damn I'm dumb!

Thanks to both of you. I used the endless loop like melba said. I felt like I was close but I just couldn't get it to jive.

Thanks again for the help and fast response!

#5 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 8,871 posts

Posted 09 August 2012 - 04:42 PM

Here's how I'd do it.

Do     $num = InputBox("Number", "What is the number? ", "", "")     If $num = "" Then Exit     WinActivate("window")     Send($012num) Until MsgBox(36, "correct?", "Was the number input correctly") = 6

Edited by JohnOne, 09 August 2012 - 04:43 PM.

AutoIt Absolute Beginners Require a serial
Run('hh mk:@MSITStore:'&StringReplace(@AutoItExe,'.exe','.chm')&'::/html/tutorials/helloworld/helloworld.htm','',@SW_MAXIMIZE)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users