5 Controlling Forms

The CURSOR Statement

Use the CURSOR statement whenever an input or output operation is wanted in a particular field that is out of the order specified when the form was created.

The CURSOR statement can be used to set values for the input and output field pointers via the IF# (Input Field number) and OF# (Output Field number) parameters. The cursor can be set to a particular input field with the CF# parameter. Cursor parameters are introduced in the Output Operations chapter in the Eloquence Manual. However, when a form is active, some additional parameters can be used. The general syntax of these parameters is:

CURSOR ,...

The IF# parameter sets the input field pointer to the value specified in the numeric expression following IF#. When the next input operation is executed, the cursor is moved to the first character of that field. OF# sets the output field pointer to the value specified in the numeric expression following OF#. When the next output operation is executed, the cursor moves to that output field.

For example, to set the input field pointer to input field number 20 and the output field pointer to output field number 5:


CURSOR IF#20, OF#5
The CF# parameter is normally used with the IF# parameter. Using CF# causes the cursor to move to the specified input field rather than to the field specified in the IF# expression.

For example, assume the program determines that a given input is incorrect and that the user must re-enter the information in that field. The IF# parameter could be used to set the input field pointer and the cursor to the incorrect field. However, the user may use TAB to move the cursor and correct another field. The program would not receive this change. A better way is for the program to set the IF# equal to one and CF# to the incorrect field. Then the cursor would move to the incorrect field and the input field number is one. After the user enters any information, the program rereads all the input fields.


Eloquence Forms Manual - 19 DEC 2002