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
andsm_n_copyarray
copy the contents of the specified source array into a target array. For each destination array occurrence, themdt
property is set toPV_YES
and thevalided
property toPV_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:
- If the source data is too long for its target, Panther truncates it automatically and issues no warning.
- If the data is too short, Panther pads the target occurrence with spaces.
sm_clear_array, sm_getfield, sm_putfield