Programming Guide



sm_*clear_array

Clears all data in an array

int sm_clear_array(int field_number);
int sm_n_clear_array(char *field_name);
int sm_1clear_array(int field_number);
int sm_n_1clear_array(char *field_name);

field_name, field_number
A field in the array to clear.

Returns

Description

sm_clear_array clears all data from the array that contains field_number or field_name and resets the number of occurrences in the array to 0. The array is cleared even if it is protected from clearing.

sm_1clear_array and sm_n_1clear_array only clear the specified array; sm_clear_array and sm_n_clear_array also clear arrays synchronized with the array unless they are protected from clearing.

Example

/* Clear the entire array of "names" and arrays
* synchronized with "names". */
sm_n_clear_array("names");

/* Clear the "totals" column of a screen,
* without clearing arrays synchronized with "totals". */
sm_n_1clear_array("totals");