Stripping html tags (was Re: Problem with revExecuteSQL - More)

Dave dave at looktowindward.com
Sun Nov 4 08:36:44 EST 2007


Hi

One word of warning on using a field to strip HTML text - it's VERY  
slow.

When I ran the app on a 10,000 track database, without the put/get  
field, it took 80 seconds to complete, when I ran it with the put/get  
field the time went up to 327 seconds!!!

Will the template field be quicker??

All the Best
Dave




On 2 Nov 2007, at 16:38, Eric Chatonet wrote:

> Hi Richard,
>
> Thanks to you for sharing this code snippet from Ken:
> I was not using the field method (we discussed about this may be  
> two years ago) because, if I remember well (but it's a bit confused  
> in my mind), we found it had to be placed in a substack to avoid  
> some problem I don't even remember, etc.
>
> But using a virtual field sounds really great :-)
> Kudos to Ken to have had this illumination!
> I am not so surprised...
>
> Nevertheless, stripTags function can help because it is able to  
> master special tags that may be Rev just suppress...
> This is for Andre :-)
>
> I saw that Jim posted the function a bit modified.
> The one used in the Rev Search Engine is, as I said, in the card's  
> script and is not protected then accessible by all who have Rev 2.7  
> of later.
>
> Le 2 nov. 07 à 17:17, Richard Gaskin a écrit :
>
>> Dave wrote:
>>> Yes, I'm sure thats the function we were talking about!
>>> Where can I  get it from?
>>
>> I don't know where that one resides, but when I need to strip HTML  
>> tags from text I just set the htmlText of a field and then get the  
>> text of that field.
>>
>> Ken Ray recently discovered this works with the templateField as  
>> well, so you don't need to rely on a physical field to do this:
>>
>> function html2text pHtml
>>     put the htmlText of the templateField into tSaveData
>>     set the htmlText of the templateField to pHtml
>>     get the text of the templateField
>>     set the htmlText of the templateField to tSaveData
>>     return it
>> end html2Text
>>
>>
>> -- 
>>  Richard Gaskin
>>  Managing Editor, revJournal
>
>
> Best regards from Paris,
> Eric Chatonet.
> ----------------------------------------------------------------
> Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
> Email: eric.chatonet at sosmartsoftware.com/
> ----------------------------------------------------------------
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list