Module HtmlWrite_Mixin.pkg

     1//****************************************************************************//
     2//                                                                            //
     3// $File name  : HtmlWrite_mixin.PKG                                          //
     4// $File title : HTML conversion functions                                    //
     5// $Author     : John Tuohy                                                   //
     6//                                                                            //
     7// Confidential Trade Secret.                                                 //
     8// Copyright 1998-1999 Data Access Corporation, Miami FL, USA                 //
     9// All Rights reserved                                                        //
    10// DataFlex is a registered trademark of Data Access Corporation.             //
    11// $Rev History                                                               //
    12//                                                                            //
    13//                                                                            //
    14//                                                                            //
    15//****************************************************************************//
    16
    17// create standard html write commands. This expect that the
    18// message WriteHtml already exists
    19//
    20// Current messages
    21//
    22//  WriteHtmlBreak String WrStr                    writes line with a     <br>
    23//  WriteHtmlHorzLine                              writes horizontal line <hr>
    24//  WriteHtmlTableBegin String sParams             starts a table         <table>
    25//  WriteHtmlTableEnd                              end a table            </table>
    26//  WriteHtmlRowBegin                              start a row            <tr>
    27//  WriteHtmlRowEnd                                end a row              </tr>
    28//  WriteHtmlCell String sData String sAlign       create a data cell     <td>
    29//  WriteHtmlCellHeader String sData string sAlign create a header cell   <th>
    30//
    31use VDFBase.pkg
    32
    33{ ClassLibrary=Common }
    34Class HtmlWrite_mixin is a Mixin
    35
    36    Procedure WriteHtmlBreak String sHtml
    37        if (Num_Arguments>0) Send WriteHtml sHtml
    38        Send WriteHtml "
"
39 End_Procedure 40 41 Procedure WriteHtmlHorzLine 42 Send WriteHtml "
"
43 End_Procedure 44 45 Procedure WriteHtmlTableBegin String sParams string sPer 46 String sHtml 47 Case Begin 48 Case (Num_Arguments=2) Move ('-sParams-'" width="'-sPer-'%" >')tosHtml 49Case(Num_Arguments=1)Move(' * sParams * '>') to sHtml 50 Case else Move '
'tosHtml 51Caseend 52SendWriteHtmlsHtml 53End_Procedure 54 55ProcedureWriteHtmlTableEnd 56SendWriteHtml'
'
57 End_Procedure 58 59 Procedure WriteHtmlRowBegin 60 Send WriteHtml '' 61 End_Procedure 62 63 Procedure WriteHtmlRowEnd 64 Send WriteHtml '' 65 End_Procedure 66 67 Procedure WriteHtmlCell String sData String sAlign 68 string sAl sHtml 69 Move (If( Num_Arguments=1, 'align="center" valign="top"', sAlign)) to sAL 70 If sData Eq "" Move " " To sData 71 Move (' + sAl + '>' + sData + '') to sHtml 72 Send WriteHtml sHtml 73 End_Procedure 74 75 Procedure WriteHtmlCellHeader String sData string sAlign 76 string sAl sHtml 77 Move (If( Num_Arguments=1, 'align="center" valign="top"', sAlign)) to sAL 78 If sData Eq "" Move " " To sData 79 Move (' + sAl + '>' + sData + '') to sHtml 80 Send WriteHtml sHtml 81 End_Procedure 82 83end_class 84