View Complete Thread | FoxWeb Forum Home
Search:
Date:    Msg ID:   
From:    Thread:   
Subject:   
This is an excellent tip!  Not only it offers a work-around to a problem with VFP's STRTRAN function, but it also provides a great way to add regular expressions to FoxWeb and other VFP programs.  My recommendation is that you declare the object in fw_enter.prg, after checking that it was not created in a previous request.

FoxWeb Support Team
support@foxweb.com

Sent by Oleg Goncharuk on 11/23/2001 02:49:30 AM:
We had found, that VFP6 function STRTRAN behaves strangely with large files.

Often we need to display pieces of HTML or XML code on page and use following code for this:
   cHTM=STRTRAN(cHTM,"<","&lt;")
   cHTM=STRTRAN(cHTM,">","&gt;")
It works quick with small pieces of code, but once we had tried to convert a large text (about 140Kb)  heavily loaded with tags (it was exported from MSWORD) and we where astonished to see that it took about 15 minutes!

SOLUTION:

We had created RegExp object like this CREATEOBJECT("VBScript.RegExp")
wrote with it function similar by input parameters with VFP STRTRAN and run it against the same file with same parameters - it went like a flash...

/Oleg