Navigation: Language Reference > 13 - Built-in Functions >====== STOP (suspend program execution) ====== | |
STOP( [ message ] )
STOP | Suspends program execution and displays a message window. |
message | An optional string expression (up to 64K) which displays in the error window. |
STOP suspends program execution and displays a message window. It offers the user the option of continuing the program or exiting. When exiting, it closes all files and frees the allocated memory.
Example:
PswdScreen WINDOW
STRING(' Please Enter the Password '),AT(5,5)
ENTRY(@10),AT(20,5),USE(Password),PASSWORD
END
CODE
OPEN(PswdScreen) !Open the password screen
ACCEPT !and get user input
CASE ACCEPTED
OF ?Password)
IF Password <;> 'PayMe$moRe' !Correct password?
STOP('Incorrect Password Entered – Access Denied – Retry?')
X# += 1
IF X# > 3 !Let them try 3 times
HALT(0,'Incorrect password') !then throw them out
END
END
END
END
See Also: