Process the supplied data (assumed to be text) by replacing any incident percent entities by thier 'here and now' values. The data is supplied as a chain which remains in situ and will be unchanged if there are no succesful percent entity conversions. Returns: None

Return TypeFunction nameArguments
voidhdsApp::ConvertText(hzChain&,hzHttpEvent*,)

Declared in file: hzDissemino.h
Defined in file : hdsSystem.cpp

Function Logic:

0:START 1:unknown 2: No text 3:unknown 4:unknown 5:unknown 6:unknown 7:items 8:zi 9:unknown 10:unknown 11:items zi 12:unknown 13:unknown 14:rc 15:unknown 16:unknown 17:items 18:items items 19:zi 20:items items 21:items Z 22: No text

Function body:

void hdsApp::ConvertText (hzChain& Z)hzHttpEvent* pE, 
{
   //  Process the supplied data (assumed to be text) by replacing any incident percent entities by thier 'here and now' values. The data is supplied
   //  as a chain which remains in situ and will be unchanged if there are no succesful percent entity conversions.
   //  
   //  Arguments: 1) Z Data to be treated as text which may contain one or more percent entities.
   //     2) pE The HTTP event from which the non system and non user variables can be garnered or from which the user can be established.
   //  
   //  Returns: None
   _hzfunc("hdsApp::ConvertText(1)") ;
   hzChain     W ;             //  Variable name buffer
   hzChain     C ;             //  Final value
   chIter      zi ;            //  Interation of contnt
   hzAtom      atom ;          //  User profile record variable
   hzString    pcntEnt ;       //  Constructed variable name
   hzEcode     rc ;            //  Variable location. 1 system, 2 event, 3 session, 4 user value (must be logged in with session & cookie)
   if (!Z.Size())
       return ;
   for (zi = Z ; !zi.eof() ;)
   {
       if (*zi == CHAR_AT)
       {
           if (zi == "@resarg;")
           {
               if (pE->m_Resarg)
                   C << pE->m_Resarg ;
               zi += 8;
               continue ;
           }
       }
       if (*zi == CHAR_PERCENT)
       {
           if (zi[1]== CHAR_PERCENT)
               { C << "%%" ; zi += 2; continue ; }
           if (IsAlpha(zi[1])&& zi[2]== CHAR_COLON && IsAlpha(zi[3]))
           {
               if (AtPcEnt(pcntEnt, zi))
               {
                   rc = PcEntConv(atom, pcntEnt, pE) ;
                   if (atom.Type() != BASETYPE_UNDEF)
                   {
                       if (atom.IsSet())
                           C << atom.Str() ;
                   }
                   else
                   {
                       m_pLog->Log("Atom type unknown %s\n", *pcntEnt) ;
                       C << pcntEnt ;
                   }
                   zi += pcntEnt.Length() ;
                   continue ;
               }
           }
       }
       C.AddByte(*zi) ;
       zi++ ;
   }
   Z.Clear() ;
   Z = C ;
}