Jump to content

New user, need help, what function do I use


 Share

Recommended Posts

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 :D:

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

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

  • Moderators

peterj04,

Welcome to the AutoIt forum. :D

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. :huggles:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...