Module HtmlEncode.pkg

     1//****************************************************************************//
     2//                                                                            //
     3// $File name  : HtmlEncode.pkg                                               //
     4// $File title : HtmlEncode global function                                   //
     5// Notice      :                                                              //
     6// $Author(s)  : John Tuohy                                                   //
     7//                                                                            //
     8// Confidential Trade Secret.                                                 //
     9// Copyright 1998-1999 Data Access Corporation, Miami FL, USA                 //
    10// All Rights reserved                                                        //
    11// DataFlex is a registered trademark of Data Access Corporation.             //
    12// $Rev History                                                               //
    13//                                                                            //
    14// $Rev History                                                               //
    15//                                                                            //
    16//                                                                            //
    17// JJT/JW 9/8/98  Added HtmlEnocdeNoCrlf as per JW                            //
    18// JJT 8/28/98    created                                                     //                                                   //
    19//****************************************************************************//
    20
    21
    22
    23Function HtmlEncodeNoCrLf Global string sDat Returns string
    24       Move (Replaces("&",sDat,"&"))          to sDat // must do this first!
    25       Move (Replaces("<",sDat,"<"))           to sDat
    26       Move (Replaces(">",sDat,">"))           to sDat
    27       Move (Replaces('"',sDat,"""))         to sDat
    28       Move (Replaces("'",sDat,"'"))          to sDat // can't use apos
    29       Function_Return sDat
    30End_Function
    31
    32
    33Function HtmlEncode Global string sDat Returns string
    34       Get HtmlEncodeNoCrLF sDat to sDat
    35       Move (Replaces(character(10),sDat,""))     to sDat
    36       Move (Replaces(character(13),sDat,"
"
)) to sDat 37 Function_Return sDat 38End_Function 39 40 41