wcSetVariable( )

Syntax . . Returns . . Tips . . Program Example . . Related Topics . . A-Z Index . . Home

Assigns a value to a particular variable.

Example

returnCode = wcSetVariable(cntrlHandle, "$myvar", "value");

Syntax

 int wcSetVariable(void *controlHandle, 
                   char *varName, 
                   char *value)
controlHandleThe handle to the control structure.
varNameName of the variable for which you want to set the value. Variable names are case-sensitive, begin with a "$", and consist of alphanumeric characters with a maximum of 80 characters. Variable names may not include underscore characters.
valueThe new value to assign to the variable.

Returns

0Success.
Error codeFailure or exception. For a list of possible error codes, see Error Messages.

Tips

Program Example

The following code shows how wcSetVariable( ) is used in an application.


    wcGetVariable(wcp, "$MIval", &mival);

    if (mival==NULL)
        wcSetVariable(wcp, "$MIval", "firstpage");

Related Topics

wcGetVariable( )
wcDropVariable( )


Top of Page . . Syntax . . Returns . . Tips . . Program Example . . A-Z Index . . Home