Subject Re: evaltags in a custom report
From Ken Mayer <dbase@nospam.goldenstag.net>
Date Sat, 8 May 2021 10:15:36 -0700
Newsgroups dbase.getting-started

On 5/8/2021 6:54 AM, Charlie wrote:
> OK so the tags are invisible in the text but they function.  For instance (br) causes the next line etc.  My question was is there some sort of a property I can change to make them not function in this particular text component in the report.  Actually if there is a way to get rid of them before they hit the report makes more sense.  So I will try your code in a program leading up to the report.  Now that I understand that they are a problem I can try to eliminate them by program or manually from now on.  Not a big deal now that I understand it is probably not possible in the report.
>

Well, again using a textLabel would ignore them, but it would display them.

This function was written for the Web Tutorial project, and works pretty
well -- it removes tags (between < and >) and seems to do okay if there
is, say a lone < or a lone > in the string ...

    function stripTags( cString )
       private nBracket, nStart, nEnd
       nBracket = AtCount( "<", cString ) // function below from
:dUFLP:StringEx.cc
       // loop through, finding each occurance of the < symbol,
       // and going to the > symbol:
       if nBracket > 0 // if we have any at all:
          do while AtCount( "<", cString ) > 0 // loop until done
             nStart = at( "<", cString )
             nEnd = at( ">", cString )
             // if no > symbol, there's no HTML tag ...
             if nEnd > 0
                cString = stuff( cString, nStart, (nEnd - nStart + 1 ), "" )
             else
                exit // out of loop
             endif // nEnd > 0
          enddo // loop
       endif // nBracket > 0

    return cString
    // end of method: stripTags()


Ken


--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm
dBASE Web Tutorial: http://www.goldenstag.net/dbase/WebTutorial/00_Menu.htm