Was this helpful?
Positioning the Cursor
The resume statement and its variations control the placement of the cursor on a displayed form.
The resume statement returns the cursor to the current field. This statement is especially useful when the frame is first called and as the cursor returns to the screen following an activation.
The resume statement breaks out of the current operation before moving the cursor to the indicated place. Thus, you can use resume to break out of loops. Because resume closes the current operation, it is usually the last statement in an operation specification. However, you can place the resume anywhere in a 4GL specification.
If the form has no fields or if all fields are "display only," the cursor rests on the menu line. The cursor can rest on a table field in read mode.
Cursor position has these limitations:
The cursor cannot rest on a derived field.
The cursor can never rest on a field designated "display only," regardless of its mode.
The cursor cannot rest on a field designated "query only," except when the form is in query or fill mode.
The cursor cannot rest on a "display only" simple field. However, it can rest on the first column of a display-only table field, all of whose columns are display only.
Initial Cursor Position
As a frame starts up, the default positioning of the cursor is on the field with sequence number 1 as defined in VIFRED through the ABF FormEdit operation.
If all fields are "display only" or "query only," or if the form has no fields, the cursor starts on the menu line.
If you want to position the cursor somewhere other than at its default starting point, include a resume field statement as the last statement in the initialization.
The example below places the cursor on the Empname field, whether or not Empname has sequence number 1:
initialize = 
begin 
  resume field empname; 
end
Repositioning the Cursor
Whenever control returns to the application user after an activation, the cursor returns by default to the field on which it was resting before the activation. You can position the cursor elsewhere by using one of these variants of the resume statement:
resume entry
Leaves the cursor on the current field and causes any before activation for that field to occur
resume field
Positions the cursor on a field or column on the form (except for derived and display-only fields) and causes any entry activation set for that field to occur
resume menu
Positions the cursor on the menu line
resume next
Must appear within a field activation. It completes the operation that caused the field activation to take place, which can be a cursor movement, menu, or key activation.
resume nextfield
Must appear within an initialization or activation. The resume nextfield statement positions the cursor on the next accessible field on the form, and causes any before activation for that field to occur.
resume previousfield
Must appear within an initialization or activation. The resume previousfield statement positions the cursor on the previous field on the form that is accessible, and causes any before activation for that field to occur.
Last modified date: 08/28/2024