Programming Guide |
Changes the state of the LDB
int sm_ldb_state_set (char *ldbname, int state_type, int new_value);int sm_ldb_h_state_set (int ldbhandle, int state_type, int new_value);
ldbname
- The name of the LDB whose state you want to set.
ldbhandle
- The integer handle of the LDB whose state you want to set.
state_type
- Specifies the state to set with one of these constants:
LDB_ACTIVE
- A Yes/No flag that specifies whether the LDB is active. Only active LDBs participate in LDB write-through.
LDB_READ_ONLY
- A Yes/No flag that specifies whether the LDB is read-only. The default for newly activated LDBs is set to No. Screens can read from this LDB on screen entry but cannot modify it on exit; consequently, a read-only LDB cannot be used to transfer values from one screen to another.
new_value
- A value of 1 (Yes) or 0 (No) to set for
state_type
.
sm_ldb_state_set
lets you change the status of an LDB in one of two ways:
- Allow or disallow participation in LDB write-through. If a loaded LDB has its active state (
LDB_ACTIVE
) set to Yes, screens can, at a minimum, read its data; if the LDB'sLDB_READ_ONLY
state is set to No, screens can also write data to it. For more information about LDB write-through, refer to "Using Local Data Blocks" in Application Development Guide.
Note: You can call
sm_ldb_state_set
only on LDBs that are already loaded into memory. To load an LDB at runtime, call sm_ldb_load.