Contents > CFML Reference > ColdFusion C++ CFX Reference > CCFXRequest class > CCFXRequest::SetVariable PreviousNext

CCFXRequest::SetVariable

void CCFXRequest::SetVariable(LPCSTR lpszName, LPCSTR lpszValue)

Sets a variable in the calling template. If the variable name already exists in the template, its value is replaced. If it does not exist, a variable is created. The values of variables created using SetVariable can be accessed in the same manner as other template variables (for example, #MessageSent#).

Parameter

Description

lpszName

Name of variable

lpszValue

Value of variable

The following example sets the value of a variable named 'MessageSent' based on the success of an operation performed by the custom tag:

BOOL bMessageSent;
...attempt to send the message...
if ( bMessageSent == TRUE )
{
pRequest->SetVariable( "MessageSent", "Yes" ) ;
}
else
{
pRequest->SetVariable( "MessageSent", "No" ) ;
}

Contents > CFML Reference > ColdFusion C++ CFX Reference > CCFXRequest class > CCFXRequest::SetVariable PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.