User Guide
308 Developing Web Applications with ColdFusion
Example
The following example checks to see whether the DEBUG attribute is present, and if it
is, it writes a brief debug message:
if ( pRequest->Debug() )
{
pRequest->WriteDebug( "Top secret debug info" ) ;
}
CCFXStringSet Class
Abstract class that represents a set of ordered strings. Strings can be added to a set and
can be retrieved by a numeric index (the index values for strings are 1-based). To create
a string set, you should use CCFXRequest::CreateStringSet.
Class members
virtual int AddString( LPCSTR lpszString )
CCFXStringSet::AddString adds a string to the end of the list.
virtual int GetCount()
CCFXStringSet::GetCount gets the number of strings contained in the list.
virtual LPCSTR GetString( int iIndex )
CCFXStringSet::GetString gets the string located at the passed index.
virtual int GetIndexForString( LPCSTR lpszString )
CCFXStringSet::GetIndexForString gets the index for the passed string.
CCFXStringSet::AddString
int CCFXStringSet::AddString(LPCSTR
lpszString
)
Adds a string to the end of the list. Returns the index of the string that was added.
lpszString
String to add to the list.
Example
The following example demonstrates adding three strings to a string set and saving the
indexes of the items that are added:
CCFXStringSet* pSet = pRequest->CreateStringSet() ;
int iRed = pSet->AddString( "Red" ) ;
int iGreen = pSet->AddString( "Green" ) ;
int iBlue = pSet->AddString( "Blue" ) ;