Page 1 of 1

Help with the 'HTMLDecode' procedure

Posted: 2007-02-18 00:44:38
by IBB
Hi,

I am currently developping a new script and I seem to have a problem with the HTMLDecode procedure.

I would like it to transform the <br> tags (in a long description with several returns to a new line) into returns to new lines. But the HTMLDecode procedures does nothing.

I konw it is possible (it works with the Allociné script) but I don't know how to do it

Thanks for your help :) :??:

Posted: 2007-02-18 02:03:53
by bad4u
Always nice to see someone spending time on new scripts ;)

If I understand your question correct, you want to replace the website's HTML command <br> into a script's linebreak.

The function you are looking for is StringReplace(S, OLD, NEW: string): string;
This function replaces OLD by NEW from inside string S.
[HTMLDecode only decodes some special characters like "äöé.."]
For a linebreak you need to replace the <br> with a #13#10.

An example:
string01 := 'Websites HTML code <br> Second line.'
string01 := StringReplace(string01, '<br>', #13#10);


or stringXX := StringReplace(string01, '<br>', #13#10); if you don't want to change string01.

Now the result should look like:
Websites HTML code
Second Line.


If you have not done yet, you should have a look on the AMC helpfile / topic "script files creation" - it's really useful.

Posted: 2007-02-18 02:39:11
by IBB
Worked great, thanks a lot :grinking:

The script is for Moby Games, a nice database about Video Games, to be released soon :p

Posted: 2007-02-18 14:58:18
by antp
HTMLDecode is for HTML Entities (&something;), not for HTML Markup (<something>)