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
Help with the 'HTMLDecode' procedure
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.
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.
Last edited by bad4u on 2007-02-18 12:06:21, edited 1 time in total.