'Dosify' a chain (convert instances of newline into carriage return newline. Note that chains cannot be dosified more than once by mistake. The instances of newline are not converted to CR-NL unless they lack the preceeding CR

Return TypeFunction nameArguments
hzEcodeDosifyChain(hzChain&,)

Declared in file: hzTextproc.h
Defined in file : hzTextproc.cpp

Function Logic:

0:START 1:unknown 2:Return E_NODATA 3:unknown 4:unknown 5:items items 6:unknown 7:items 8:unknown 9:items items 10:items 11:items Z 12:Return E_OK

Function body:

hzEcode DosifyChain (hzChain& Z)
{
   //  Category: Text Processing
   //  
   //  'Dosify' a chain (convert instances of newline into carriage return newline. Note that chains cannot be dosified more than once
   //  by mistake. The instances of newline are not converted to CR-NL unless they lack the preceeding CR
   //  
   //  Arguments: 1) Z The input chain that will be dosified by this operation
   //  
   //  Returns: E_NODATA If the source file has not been supplied
   //     E_ARGUMENT If the target file has not been supplied
   //     E_NOTFOUND If the source file cannot be found
   //     E_OPENFAIL If the source file cannot be opened
   //     E_READFAIL If the source file cannot be read
   //     E_WRITEFAIL If the target file cannot be created or written to
   //     E_OK  If the operation was successful
   hzChain     F ;     //  Resulting chain
   chIter      zi ;    //  Input chain iterator
   if (!Z.Size())
       return E_NODATA ;
   for (zi = Z ; !zi.eof() ; zi++)
   {
       if (*zi == CHAR_CR)
       {
           F.AddByte(*zi) ;
           zi++ ;
           if (*zi == CHAR_NL)
           {
               F.AddByte(*zi) ;
               continue ;
           }
       }
       if (*zi == CHAR_NL)
       {
           F.AddByte(CHAR_CR) ;
           F.AddByte(CHAR_NL) ;
           continue ;
       }
       F.AddByte(*zi) ;
   }
   Z.Clear() ;
   Z = F ;
   return E_OK ;
}