Programming Guide



sm_*doccur

Deletes occurrences from a field

int sm_i_doccur(char *field_name, int occurrence, int count);
int sm_o_doccur(int field_number, int occurrence, int count);

field_name
field_number
The field with the occurrences to delete.

occurrence
The first occurrence to delete in the array specified by field_number or field_name.

count
The number of occurrences to delete, starting with occurrence. If you supply a negative value, Panther inserts new occurrences above occurrence, with the same restrictions that apply to sm_ioccur.

Returns

Description

sm_i_doccur and sm_o_doccur delete data from count occurrences, starting with occurrence. If the array is scrolling, Panther then deallocates count occurrences. Panther moves up data in the occurrences after the last-deleted occurrence to prevent gaps in the array.

If count is equal to or greater than the number of allocated occurrences, Panther deletes all data from the array.

If other arrays are synchronized with this one, sm_doccur performs the same operation on them, provided their clearing_protect property is set to PV_NO. sm_doccur ignores the target array's clearing_protect setting.

You can use sm_doccur to insert new occurrences in a field by supplying a negative value for count. You can achieve the same effect with sm_ioccur.

This function is normally bound to the logical key DELL.

See Also

sm_ioccur