Moves the cursor into a fieldint sm_gofield (int field_number);int sm_e_gofield (char *field_name, int element);int sm_i_gofield (char *field_name, int occurrence);int sm_n_gofield (char *field_name);int sm_o_gofield (int field_number, int occurrence);
- The destination field.
- The destination element.
- The destination occurrence. If
occurrenceis offscreen, Panther scrolls it into view.
sm_gofieldputs the cursor in the first enterable position of the specified field or occurrence, according to its justification. If the field is shiftable, it is reset. If the field has embedded characters, the cursor goes to the nearest position unoccupied by a punctuation character. Use
sm_off_gofieldto put the cursor elsewhere in the field.
When called to position the cursor in a scrolling array,
sm_i_gofieldreturn an error if the occurrence number passed exceeds by more than 1 the number of allocated occurrences in the specified array.
This function does not immediately trigger field entry, exit, or validation processing. This processing occurs according to the cursor position when control returns to
If a field validation function that calls
sm_gofieldis invoked by TAB, Panther executes
sm_gofieldand moves the cursor to the specified field, then executes the TAB. To prevent this extra tab, the validation function must return non-zero. When non-zero is returned by a validation function, the field's
validedproperty is set to 0 (false). In this case, reset the property to 1 (true).
/* If the combination of this field and the previous
* one is invalid, go back to the previous for data
* entry. */
int validate (field, data, occur, bits)
int field, occur, bits;
if (bits & VALIDED)
if (!lookup (data, sm_fptr (field - 1)))
sm_novalbit (field - 1);
sm_gofield (field - 1);
sm_fquiet_err (0, "Lookup failed -\
please re-enter both items.");