| Purpose |
Input functions with cursoring. These functions are regarded as obsolete |
|||
|
Syntax |
int scrnc_map(int mapnr, int *fieldnr, char
*data) |
|||
|
Parameters |
int mapnr |
Number of map to use |
||
|
|
int* fieldnr |
Pointer to field from which to input |
||
|
|
data |
Pointer to variable in which to place input data |
||
|
|
Note that scrnh_map(), and not scrni_map(), should
be used for input of type I fields. A good C compiler will flag it
as an error if you inadvertently use scrni_map() on a DP4 type I
field. Unfortunately some compilers, including Microsoft C, only
flag this as a warning, (at least for C programs), even though it
causes a memory corruption. |
|||
|
Description |
The scrnx_map() functions are used to input data from fields where the user is allowed to cursor among them in any order. The format in which the data is displayed is controlled by the global variables scrn_flags and scrnd_flags, as in the askf_x() functions. On entry to the function the field is cleared (meaning that the data is set to the default on the database, or a zero or blank value if the field is not a database field) under the following conditions:
On return from these functions, the value of the variable pointed to by the parameter fieldnr is changed to the next field number to be processed. A field number of 0 means that the user has completed the dialog. If the user moves to another field with the mouse or cursor keys fieldnr is adjusted in such a way as to ensure any fields that would be missed out if fieldnr was set directly to the target field are validated. This is explained in detail in Field Navigation During Data Entry . If the user presses the <Esc> key, the global variable abort_code is set to the value ESCAPE and the variable pointed to by the parameter fieldnr is set to the first field in the map. If the user leaves a field with a cursor movement key, or by clicking on another field with the mouse, or requests prompt, abort_code is set accordingly as listed below: |
|||
|
|
Value |
User action |
||
|
|
UP_LINE |
User navigated with the <↑> key |
||
|
|
If the global variable range has the value 1 initially, it is updated to hold the value of the highest field number processed so far. It is recommended that the new inpm_x() functions are used rather than the scrnx_map() functions. The scrnx_map() functions are retained for compatibility with older programs. |
|||
|
Return values |
Returns a non zero value (usually the value of the global variable abort_code) if the program should break (not validate the field), or zero if the data was entered normally and should be validated. | |||
|
Remarks |
scrnc_map() allows you to enter mix cased data, whereas scrnu_map() converts all keystrokes to uppercase. scrns_map() is like scrnu_map() but converts spaces to underscore characters and only allows characters that are permitted in identifiers (and @). Usually each function is used with the corresponding DP4 datatype, but this is not manadatory. |
|||
|
See also |
||||
|
Example |
The following code includes a call to the function scrnn_map:
This code can be changed to use the function inpm_n as follows:
|
|||