PDA

View Full Version : How to prevent a next or use a screen.jump


DarrellBlack
02-16-2005, 08:39 PM
I have a screen that contains a form. The user is allow to answer using a mask but it is posible for the user to delete the placeholder infomation before hitting next. If the form is empty I want the message.dialog to popup and tell the user that the form cannot be blank. I have this part working. The problem is you can only check the form "on next" therefore you have already left the screen befoe the user gets the message. What is the best way to prevent the user from going to next if it is not filled in?

I tried:
If form is blank then
popup message
screen.jump back to screen (it will not jump back)

csd214
02-17-2005, 03:42 AM
I was about to say: That's easy¸ set _PreventNextPage = true; (default = false), but it seems I'm dreaming about that global variable.

But you are not lost; try this:

if form is blank then
popup message
else
-- advance to the next screen
Screen.Next();
end

DarrellBlack
02-19-2005, 06:44 AM
Thanks, you know what it was. I had the screen.next () under the end so it allows move forward. Fixed.

csd214
02-19-2005, 07:01 AM
The computer is infuriating accurate. You have written the most brilliant code. One line is misplaced or one single character is wrong (LUA is case sensitive) and your script crashes.

Some times I WANT the computer had artificial intelligence; that stupid box!