Focal Point
dash in HTMLFORM interpreted incorrectly

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8711058331

April 14, 2005, 07:30 PM
suzy_smith
dash in HTMLFORM interpreted incorrectly
We have a lot of our FOCUS documentation stored as web pages. And we have examples in the documentation that may have lines like -RUN in them.

In an effort to convert these pages to WebFocus, we have just created a simple .fex that wraps the existing page in -HTMLFORM BEGIN and -HTMLFORM END.

However, when running the fex, the page stops at the -RUN statement.

Other than hand-editing these pages with the html-safe version of a dash, is there some WebFOCUS setting that can be used to not have a dash be interpreted?

Thanks. Suzy

P.S. Ending html comment lines like --> on a line by itself mess things up, too.
April 14, 2005, 08:39 PM
j.gross
1. "-->" in column 1, or " -->" in 2, will inescapably be treated as a Dialog Manager directive, which will stop the music. (If you really must have --> at start of a line in the View Source, stuff it into an &variable and place a reference there.)

2. What purpose are the -RUN's intended to serve? Why not just rip them out?

If need be, rearrange the pieces to complete all non-dialog-manager Focus command processing first, and place all -HTMLFORM sections at the end, interspersed as need be by DM flow-control statements.
April 14, 2005, 08:50 PM
<Pietro De Santis>
Interestingly, according to the manual, "All lines that are not Dialogue Manager commands are assumed to be HTML".

Suzy, I think what's happening is that when WebFOCUS encounters a -RUN, it executes the WebFOCUS code before it, even though you've added a -HTMLFORM and HTML comments.

----------------------------------------

You can include HTML commands in a procedure by embedding those commands in a
procedure.
Note: The -RUN command cannot be included in the lines between the -HTMLFORM BEGIN
and -HTMLFORM END commands.
Syntax: How to Embed HTML Commands in a WebFOCUS Procedure
-HTMLFORM BEGIN
.
.
.
-HTMLFORM END
where:
-HTMLFORM BEGIN
Indicates the beginning of HTML commands.
-HTMLFORM END
Indicates the end of HTML commands.
Note: All lines that are not Dialogue Manager commands are assumed to be HTML.
April 14, 2005, 09:01 PM
suzy_smith
Thanks to you both. We knew what was happening, just didn't want it to be so, and hoped that we had overlooked some setting.

The original idea was to not need to do any hand-editing of these files, but still adhere to the WebFOCUS mantra that the FEX is REX.

The routine that converts these files from html to fex can do them all in a couple of minutes.

Our original html is valid, just not within the constraints of WebFOCUS.

Thanks. Suzy
April 14, 2005, 09:14 PM
<Pietro De Santis>
I don't know if this will help, but if you rename your documentation fexes to html files, and then -HTMLFORM them into a fex, the FOCUS code will not execute.

htmlform1.fex

-HTMLFORM htmlf1[/code]htmlf1.htm

THIS IS SOME DOCUMENTATION
-RUN
TABLE FILE CAR
PRINT *
END
-RUN
THIS IS SOME MORE DOCUMENTATION[/code]

This message has been edited. Last edited by: <Mabel>,
April 15, 2005, 02:59 PM
susannah
that's sooo clever!
April 15, 2005, 03:39 PM
suzy_smith
We are going to incorporate a test into our conversion routine that replaces a the first dash it encounters with the html special entity 'amper ndash;' and see what happens. For our situation--converting valid, working html to WebFOCUS--this will probably solve the problem

IBI should really do 2 passes on code within the HTMLFORM BEGIN and END tags. They know which commands are valid DM commands and can leave them alone. The other lines that have a leading dash can be converted to the html special entity. Then, when the code is actually run, there would be no ambiguity.
April 15, 2005, 03:55 PM
<Pietro De Santis>
Suzy,

If you convert the - in -RUN to a ndash, won't the FOCUS code run anyway, just at the end of the -HTMLFORM END?

If you do a View Source, you most likely will see that the code is run.

Just a thought.