Jump to content

Im just learning, so its a dumb question.


Recommended Posts

Sorry for an obvious question but i'm just trying to understand the terminology of this as I have only ever programmed batch files and I want to get away from them.

Im confused on how to use a returned value from a function. What is the variable that is returned and how do I use it? I am trying to understand this and creating loops.

If I display a message box which displays the OK and CANCEL buttons I know that they return values when each button is pressed but how do I read that value? I thought @error was used but it doesn't work for me. Nevermind about the very simple script below, it was just to figure this out but here's what the script should be doing:

- A loop that starts with the question "OK or Not"

- Press OK to get the "No Disk" message which loops you back to the top

- Press Cancel to exit straight away

While 1
MsgBox(1, "???", "Ok or not")
If @error == 2 Then
    Exit
EndIf
MsgBox(0, "No Disk", "No Disk In Drive")

WEnd

As you know it just stays in the loop. I just need to know how I can create this situation so I can figure the rest out for myself.

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