Programming Guide



sm_*off_gofield

Moves the cursor into a field, offset from the left

int sm_off_gofield(int field_number, int offset);
int sm_e_off_gofield(char *field_name, int element, int offset);
int sm_i_off_gofield(char *field_name, int occurrence, int offset);
int sm_n_off_gofield(char *field_name, int offset);
int sm_o_off_gofield(int field_number, int occurrence, int offset);

field_name, field_number
Specifies the destination field.

element
The destination element in field_name.

occurrence
The destination occurrence in the specified field.

offset
The position in the destination field at which to place the cursor. If offset is larger than the field's length, or greater than a shiftable field's maximum length, the cursor is placed in the rightmost position.

Returns

Description

sm_off_gofield moves the cursor into the specified field at position offset, regardless of the field's justification. If the data specified by offset is out of view, Panther shifts the field's contents to make the data visible.

Example

#include <smdefs.h>
#include <ctype.h>
/* Place cursor over the first embedded blank in */
/* the "names" field.
*/

char buf[256], *p;
int length;

length = sm_n_getfield(buf, "names");
for (p = buf; p <buf + length; ++p)
{
if (isspace(*p))
break;
}
sm_n_off_gofield("names", p - buf);

See Also

sm_disp_off, sm_gofield, sm_sh_off