The following example contains a function (SetRepeatMode) that sets a SCALAR_INT scalar (Repeat mode) for a job folder (F_INSTALLJOB, F_SRVINSTALL, or F_REMPKGJOB):
// Function to set the Repeat mode scalar for a new job folder.
SMS_STATUS SetRepeatMode(HANDLE hFolder, // Handle to job folder.
DWORD dwMode // Scalar value.
)
{
SMS_STATUS stat;
SCALAR sc;
// check if the value is valid for Repeat mode.
switch (dwMode) {
case JOBRPT_NEVER:
case JOBRPT_DAILY:
case JOBRPT_WEEKLY:
case JOBRPT_BIWEEKLY:
case JOBRPT_MONTHLY:
break;
case default:
// Return a parameter error if it is an invalid value.
return(SMS_PARAMETER_ERROR);
break;
}
sc.pszName = "Repeat mode"; // Name of the scalar to set.
sc.scType = SCALAR_INT; // Data type of scalar.
sc.dwValue = dwMode;
// Use SmsSetScalar to use the sc struct to set the
// scalar for the folder.
stat = SmsSetScalar( hFolder, // Handle to folder containing
// the scalar to set.
&sc // Pointer to SCALAR struct
// containing value to set.
);
return(stat);
}