The SmsSetScalar function sets the value of a scalar within a new folder created by SmsCreateFolder. Or SmsSetScalar can be used to set a scalar within a persistent filter created by SmsCreateFilter.
SMS_STATUS SmsSetScalar(
HANDLE hFolder, // Handle to folder or filter in which to
// set the scalar.
SCALAR *pScalarStruct // Pointer to SCALAR structure containing
// the scalar value to set.
);
The SmsSetScalar function returns a status code SMS_STATUS. If successful, the function returns a status of SMS_OK. Otherwise, it returns one of the following manifest constants:
To set the value of a scalar, both the scalar and its folder must have an access right of ACCESS_MODIFY or ACCESS_CREATE. If you do not have access to the scalar, SmsSetScalar returns an SMS_SCALAR_NO_UPDATE value. If you do not have access to the folder, SmsSetScalar returns an SMS_FOLDER_NO_UPDATE value.
In addition, the SmsSetScalar function compares the data being set by the pScalarStruct structure with the actual data type for the scalar. If your application attempts to set an integer value for a scalar with a string data type, the SmsSetScalar function does not set the scalar value and returns SMS_SCALAR_WRONG_TYPE.
To get information (such as name, data type, access rights, and so on) about the scalars within a folder, use the SmsDescribeFolder function.
Note For workstation command line folders (F_WCL), the Name scalar is also used as the identifier for the folder. When creating a new F_WCL folder, your application should ensure that this scalar is not set to a string that is already being used by another workstation command line folder within the same package folder. If the Name scalar for the folder is the same as the Name scalar for another F_WCL folder in the same package, your application will not be able to commit the new F_WCL folder.
SmsCreateFolder, SmsDescribeFolder, SmsLinkFolder, SmsCreateFilter, SmsCommitFilter