Jump to content

looping


Recommended Posts

Hi

I very new to this and am struggling, I have wrote a script to move some data around for me and now I want it to ask at the end, are there any more requests yes/no? and then if yes then start again and if no then quit. I know the quit command is Then Exit but thats about as much as I have been able to find.

Also I am looking to replace:

If $details1 = "" Then Exit

With something that asks if the user would like to start again, if so go to the start of the script else quit.

Thanks

Link to comment
Share on other sites

Can you give a sample of the script you made ?

I firstly think to have a big loop in the whole script, at the end you can ask the user if he want restart the script (MsgBox) then (depending on the result) if the user want to quit use "ExitLoop" else continue the loop or do what you want...

Link to comment
Share on other sites

Use MsgBox for the last part with a flag of 36 for yes and no buttons, and a question mark icon. Its in the help file...look it up.

$var = MsgBox(36, "Query", "Are there any more requests?")

There are a few ways you can go about the looping part...Do, While, or a simple if. The message box will return a value depending on which button is clicked. 6 = yes, 7 = no.

Pink Floyd - The Wall
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...