If the flags are 0, then the variable named in m_Tag must be null for the subtags of <xcond> to be executed. Otherwise the named variable must exist and be non-null for the subtags to be executed. Returns: None
| Return Type | Function name | Arguments |
|---|---|---|
| void | hdsCond::Generate | (hzChain&,hzHttpEvent*,uint32_t&,) |
Declared in file: hzDissemino.h
Defined in file : hdsGenerate.cpp
Function Logic:
Function body:
void hdsCond::Generate (hzChain& C)hzHttpEvent* pE, uint32_t& nLine,
{
// If the flags are 0, then the variable named in m_Tag must be null for the subtags of <xcond> to be executed. Otherwise the named variable must
// exist and be non-null for the subtags to be executed.
//
// Arguments: 1) C The HTML output chain
// 2) pE The HTTP event being responded to
// 3) nLine Line number tracker (controls NL printing)
//
// Returns: None
_hzfunc("hdsCond::Generate") ;
// hzFixPair pa ; // Tag attribute
hzPair pa ; // Tag attribute
hdsVE* pVE ; // Subtag pointer
hdsInfo* pInfo ; // User session if applicable
hzString nam ; // The variable value, if applicable
hzString val ; // The variable value, if applicable
int32_t aLo ; // First attribute
int32_t aHi ; // Last attribute
int32_t nA ; // Attribute iterator
bool bPassed ; // True if condition passed
bPassed = true ;
if (pE)
{
if (m_nAttrs)
{
pInfo = (hdsInfo*) pE->Session() ;
if (pInfo)
{
aLo = m_pApp->m_VE_attrs.First(pVE->m_VID) ;
if (aLo >&eq; 0)
{
aHi = m_pApp->m_VE_attrs.Last(pVE->m_VID) ;
for (nA = aLo ; nA <&eq; aHi ; nA++)
{
pa = m_pApp->m_VE_attrs.GetObj(nA) ;
if (*pa.value)
val = m_pApp->ConvertText(*pa.value, pE) ;
nam = *pa.name ;
if ((nam == "isnull" && val) || (nam == "exists" && !val))
{ bPassed = false ; break ; }
}
}
}
}
}
if (bPassed)
{
for (pVE = Children() ; pVE ; pVE = pVE->Sibling())
pVE->Generate(C, pE, nLine) ;
}
}