Programming Guide |
Gets the long integer value of a field
long sm_lngval(int field_number);long sm_e_lngval(char *field_name, int element);long sm_i_lngval(char *field_name, int occurrence);long sm_n_lngval(char *field_name);long sm_o_lngval(int field_number, int occurrence);
field_name
,field_number
- The field whose value is sought.
element
- The element in
field_name
that contains the data to get.occurrence
- The occurrence in the specified field that contains the data to get.
C only
- · The long value of the field.
sm_lngval
returns the contents of the specified field as a long integer. It recognizes only digit characters and a leading plus or minus sign.
#include <smdefs.h>
/* Retrieve the number of fish in one particular sea
* (a big number) from the screen. */
#define MEDITERRANEAN 4
long fish;
fish = sm_e_lngval("seas", MEDITERRANEAN);