Stg_sg()

Top  Previous  Next

Description:

API procedure, writes (sets) or reads (gets) the specified setting's member; directly returns the execution result.

Syntax:

function stg_sg(byref stg_name_or_num as string, index as byte, byref stg_value as string, op as en_stg_rdwr) as en_stg_status_codes

Returns:

One of these en_stg_status_codes: EN_STG_STATUS_OK, EN_STG_STATUS_NOT_STARTED, EN_STG_STATUS_UNKNOWN,  EN_STG_STATUS_INVALID_INDEX, EN_STG_STATUS_FAILURE, EN_STG_STATUS_INVALID.

For op= 1- EN_STG_SET, also indirectly returns the current value of the specified setting's member through the stg_value argument.

For op=0- EN_STG_GET, and when STG_TIMESTAMP is 1, also returns the setting change timestamp through the stg_timestamp global variable.

See Also:

Using Stg_sg()

 


Part

Description

stg_name_or_num

Setting name or number. If the supplied string does not start with a digit (0-9), then the string is interpreted as the name of the setting. If the string starts with a digit, then this will be interpreted as the setting number. Settings are numbered counting from 0, and in the order of their appearance in the setting configurator.

index

Setting member.

stg_value

Setting value. For set operations, the desired new setting value should be supplied through this variable. For get operations, the current setting value will be found in this variable after the stg_sg() executes.

op

Operation:

0- EN_STG_GET: get (read) the setting value.

1- EN_STG_SET: set (write) the setting value.

stg_timestamp variable

For op=1- EN_STG_SET, and when STG_TIMESTAMP is 1, this global variable should be preset with the desired timestamp prior to calling stg_sg().

Details

Callback_stg_pre_get() is called when this procedure executes with op= 0- EN_STG_GET. This provides a central location for updating setting values before returning them through the stg_get(). Callback_stg_post_set() is called for op= 1- EN_STG_SET. Again, this provides a "central location" for responding to changing setting values.

Callback_stg_error() is never called from within this procedure, so make sure to analyse the status code returned by the stg_sg().