Specifies the field in which you want to position
the cursor during the next input operation that involves that field
in a frame.
Note: Does not apply to SpeedScript
programming.
Syntax
NEXT-PROMPT field [ frame-phrase ]
|
-
field
- Indicates the name of the input field in which you want to place
the cursor the next time the user supplies input to the frame. If
the field you name is not an input field in the frame, the AVM disregards
the NEXT-PROMPT statement.
-
frame-phrase
- Specifies the overall layout and processing properties of a
frame. For more information on frame-phrase,
see theFrame phrase reference entry.
Example
This
procedure lets you update Customer information. If you do not enter a
value for Customer.Contact, the AVM positions the cursor in the
Contact field when the UPDATE statement is processed following the
UNDO, RETRY of the FOR EACH block.
r-nprmpt.p
FOR EACH Customer:
UPDATE Customer WITH 2 COLUMNS.
IF Customer.Contact EQ " " THEN DO:
MESSAGE "You must enter a contact".
NEXT-PROMPT Customer.Contact.
UNDO, RETRY.
END.
END.
|
Notes
- NEXT-PROMPT
is useful in an EDITING phrase because it can dynamically reposition
the cursor depending on input from the user.
- When you have to do complex field checking that you are unable
to do in a Dictionary validation expression or in a VALIDATE option
of the Frame phrase, use NEXT-PROMPT to position the cursor after
detecting an error.
- If the next data entry statement involving the frame specified
with NEXT-PROMPT does not use the indicated NEXT-PROMPT field, then the
AVM ignores the NEXT-PROMPT statement.
- The NEXT-PROMPT statement can affect default frame layout. In this procedure, the AVM
prompts for a and b (in that order):
r-nextp.p
DEFINE VARIABLE a AS CHARACTER NO-UNDO.
DEFINE VARIABLE b AS CHARACTER NO-UNDO.
UPDATE a b.
|
However, if you include NEXT-PROMPT b before the update statement, as shown in
the following procedure, the AVM prompts for b first and a second:
r-nextp1.p
DEFINE VARIABLE a AS CHARACTER NO-UNDO.
DEFINE VARIABLE b AS CHARACTER NO-UNDO.
NEXT-PROMPT b.
UPDATE a b.
|