Jump to content



Photo

goto equivalent


  • Please log in to reply
5 replies to this topic

#1 cyberal

cyberal

    Seeker

  • Active Members
  • 14 posts

Posted 27 February 2012 - 06:19 PM

Is there anything like a batch file "goto"
I have a input box that says Enter "(Q)uick" or "(F)ull" and I want to test for whether Q
or F was input and if not, then re-ask the question. If it is Q or F then continue the
execution. OR maybe a sample of how to it or point me in the right directio in help.
Thanks much
cyberal
Yah, I'm an old fart, but what the hey, still enjoy keeping busy







#2 BigDod

BigDod

    The Mayor of Mirth

  • Jokers
  • 8,199 posts

Posted 27 February 2012 - 06:21 PM

AutoIt uses functions, have a look at the help file and do the examples

Time you enjoyed wasting is not wasted time ......T.S. Elliot

Suspense is worse than disappointment................Robert Burns

God help the man who won't help himself, because no-one else will...........My Grandmother

Get Beta versions Here Get latest SciTE editor HereAutoIt 1-2-3 by Valuater - A great starting point.BigDod2.gifbd1.png


#3 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 7,068 posts

Posted 27 February 2012 - 06:25 PM

Here's one way of doing it:

While 1     $Test = InputBox("Test", "Enter (Q) or (F)")     If $Test = "Q" Or $Test = "F" Or @error = 1 Then ExitLoop WEnd MsgBox(0, "", "You entered: " & $Test)

There are, of course, many ways of going about it, this is the one that I came up with off the top of my head.

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#4 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,757 posts

Posted 27 February 2012 - 06:26 PM

cyberal,

Is there anything like a batch file "goto"

No, you need to use structured coding like this:
While 1     $sInput = StringUpper(InputBox("Question", "Enter 'F'(ull) or 'Q'(uick)"))     Switch $sInput         Case "F", "Q"             ExitLoop         Case Else             MsgBox(0, "Oi!", "I said 'F' or 'Q' - why did you enter " & $sInput & "?")     EndSwitch WEnd MsgBox(0, "Congrats", "You entered " & $sInput)

All clear? :oops:

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

#5 cyberal

cyberal

    Seeker

  • Active Members
  • 14 posts

Posted 27 February 2012 - 06:42 PM

Brewmannh and Melba23,
Thanks so much. I am pretty new at this but I can see this will work perfectly!
cyberal
Yah, I'm an old fart, but what the hey, still enjoy keeping busy

#6 Mechaflash

Mechaflash

    Sons of Anarchy

  • Active Members
  • PipPipPipPipPipPip
  • 1,361 posts

Posted 27 February 2012 - 07:05 PM

@cyberal

Keep working at it :oops: . I came from a windows scripting background, and have been working in AutoIT for about 3 weeks. I believe there isn't much that AutoIT can't do. You can build a menial script, or an enterprise app with it.
“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users