Initializing help system before first use

XSLPchgcvar

XSLPchgcvar


Purpose
Add or change the value of the character string corresponding to an SLP character variable
Synopsis
int XPRS_CC XSLPchgcvar(XSLPprob Prob, int nSLPCVar, char *cValue);
Arguments
Prob 
The current SLP problem.
nSLPCVar 
The index of the character variable being changed. An index of zero will create a new variable.
cValue 
Character buffer holding the value of the character variable (not its name, which is created by XSLPaddnames if required).
Example
Assuming that character variable 7 has already been created, the following example changes its value to "new value" and creates a new character variable called BoxName with the value "Jewel box"
XSLPchgcvar(Prob,7,"new value");

XSLPchgcvar(Prob,0,"Jewel box");

XSLPgetintattrib(Prob,XSLP_CVS,&n);
XSLPaddnames(Prob,XSLP_CVNAMES,"BoxName",n,n);
Integer attribute XSLP_CVS holds the number of character variables in the problem.
Further information
Character variables can be used in formulae instead of strings, and are required in certain cases where the strings contain embedded spaces.
Related topics