Syntax
HRESULT SetVariableByName(
[in] BSTR Name,
[in] long Type,
[in] BSTR Default,
[in] BSTR Value,
[in] long Persist,
[out, retval] VARIANT_BOOL* Success
);
Parameters
Name
[in] Name of the Variable to change.
Type
[in] Variable type.
Default
[in] Default value for the specified Variable.
Value
[in] Current value for the Variable.
Persist
[in] Set to 1 to make the Variable persistent, 0 to clear the persistent flag.
Success
[out, retval] TRUE if specified Variable settings were updated, FALSE if updating the
Variable failed.
Remarks
Use SetVariableByID to modify the Variable’s name.
Default and Value
The returned value is a string that represents the stored value of the Variable. The string value will need to be
converted by the caller into the actual type, e.g. a Variable of type
long
.
The format for the returned string depends on the Variable’s type (see
GetVariableType ( VarId )
).
Persistence
When a Variable is persistent, the value of the Variable is stored to permanent storage each time it is changed.
So, if the device is reset or the power is turned off, the Variable will still have its last value when the system
restarts.
If the Variable is not persistent, then the Variable’s value is set to its default whenever the system restarts.
SetVariableGroup ( VarId, Group )
Assigns a group name to a Variable.
Syntax
HRESULT SetVariableGroup(
[in]long VarId,
[in]BSTR Group,
[out, retval]VARIANT_BOOL* Success
);
Parameters
VarId
[in] ID of the Variable.
Group
[in] A group name to assign to the Variable.
Success
[out, retval] TRUE if the Variable was successfully updated, FALSE if the Variable failed to
be changed.
16