Programming Guide


Copies the contents of one array to another

int sm_copyarray(int target_fnum, int source_fld);
int sm_n_copyarray(char *target_fname, char *source_name);

target_fnum, target_fname
An element in the array to receive the data.

source_fld, source_name
An element in the source array.



sm_copyarray and sm_n_copyarray copy the contents of the specified source array into a target array. For each destination array occurrence, the mdt property is set to PV_YES and the valided property to PV_NO to indicate that the occurrence is modified and needs validation.

Because sm_copyarray references fields by number, they must be on the current screen. sm_n_copyarray looks for the named fields first in the current screen; if the screen omits one or both of the specified arrays, the function looks for the named entry in the current LDB. If found there, sm_n_copyarray gets the data from or writes to that entry.

Source and target arrays must be compatible to ensure the integrity of the copied data. Otherwise, Panther handles differences between the two arrays as follows:

See Also

sm_clear_array, sm_getfield, sm_putfield