Ccfxstringset::getcount; Ccfxstringset::getindexforstring - MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual

Developing web applications with coldfusion
Table of Contents

Advertisement

Chapter 18: Building Custom CFAPI Tags

CCFXStringSet::GetCount

int CCFXStringSet::GetCount(void)
Gets the number of strings contained in the string set. This value can be used along
with
CCFXStringSet::GetString
remember that the index values for strings in the list begin at 1).
Returns the number of strings contained in the string set.
Example
The following example demonstrates using
CCFXStringSet::GetString
back to the user:
int nNumItems = pStringSet->GetCount() ;
for ( int i=1; i<=nNumItems; i++ )
{
}

CCFXStringSet::GetIndexForString

int CCFXStringSet::GetIndexForString(LPCSTR lpszString )
Does a case insensitive search for the passed string.
If the string is found, its index within the string set is returned. If it is not found, the
constant
lpszString
String to search for.
Example
The following example illustrates searching for a string and throwing an exception if it
is not found:
CCFXStringSet* pAttribs = pRequest->GetAttributeList() ;
int iDestination =
if ( iDestination == CFX_STRING_NOT_FOUND )
{
}
to iterate over the strings in the set (when iterating,
to iterate over a string set and write the contents of the list
pRequest->Write( pStringSet->GetString( i ) ) ;
pRequest->Write( "<BR>" ) ;
CFX_STRING_NOT_FOUND
pAttribs->GetIndexForString("DESTINATION") ;
pRequest->ThrowException(
"DESTINATION attribute not found."
"The DESTINATION attribute is required "
"by this tag." ) ;
along with
GetCount
is returned.
309

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-DEVELOPING WEB and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 4.5

Table of Contents