DSSetParam
Use the DSSetParam function to set job parameter values before you run a job. Any parameter that is not explicitly set uses the default value.
Syntax
int DSSetParam(
DSJOB JobHandle,
char *ParamName,
DSPARAM *Param
);
Parameters
JobHandle is the value returned from DSOpenJob.
ParamName is a pointer to a null-terminated string that specifies the name of the parameter to set.
Param is a pointer to a structure that specifies the name, type, and value of the parameter to set.
Note: The type specified in Param need not match
the type specified for the parameter in the job definition, but it
must be possible to convert it. For example, if the job defines the
parameter as a string, it can be set by specifying it as an integer.
However, it will cause an error with unpredictable results if the
parameter is defined in the job as an integer and a nonnumeric string
is passed by DSSetParam.
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
- Token
- Description
- DSJE_BADHANDLE
- Invalid JobHandle.
- DSJE_BADSTATE
- Job is not in the right state (compiled, not running).
- DSJE_BADPARAM
- Param does not reference a known parameter of the job.
- DSJE_BADTYPE
- Param does not specify a valid parameter type.
- DSJE_BADVALUE
- Param does not specify a value that is appropriate for the parameter type as specified in the job definition.
- DSJE_SERVER_ERROR
- Internal error. Engine returned invalid data.
Remarks
The job specified by JobHandle must be locked, using DSLockJob, before the DSSetParam function is called.