![]() | Programming Guide | ![]() |
Puts a string into a field
int sm_putfield(int field_number, char *data);int sm_e_putfield(char *field_name, int element, char *data);int sm_i_putfield(char *field_name, int occurrence, char *data);int sm_n_putfield(char *field_name, char *data);int sm_o_putfield(int field_number, int occurrence, char *data);
field_name, field_number- The field to receive the contents of
data.element- The element in array
field_nameto receive the string.occurrence- The occurrence in the field to receive the string.
data- A pointer to the string to put in the specified field or occurrence.
- 0 Success.
sm_putfieldmoves the string indatainto the specified field, if it differs from the existing value. If the string is too long, Panther truncates it without warning. If the string is shorter than the destination field, Panther blank fills it according to the field's justification. If data points to an empty string, the field is cleared. This refreshes date and time fields that take system values.
sm_putfieldsets the field'smdtproperty toPV_YESto indicate that it is modified, and clears its valided property toPV_NOto indicate that the field requires validation on exit. If you use variantssm_n_putfieldorsm_i_putfieldandfield_nameis absent from the screen, the value of data is put in the corresponding LDB entry.
#include <smdefs.h>
sm_putfield(1, "This string has 29 characters");
sm_deselect, sm_dtofield, sm_getfield, sm_itofield, sm_ltofield
![]()
![]()
![]()
![]()