KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Controlling Carriage returns when using 4D Tags
PRODUCT: 4D | VERSION: 15 | PLATFORM: Mac & Win
Published On: July 17, 2015

PROCESS 4D TAGS, including pre 4D v13 PROCESS HTML TAGS, has been primarily used in the processing of web pages. For the most part Carriage Returns, CR, are ignored in HTML markup. For example:
<DIV>
    This is a lable
</DIV>

will be displayed on one line, not three as it is in the html raw source.

However, there are conditions where the use of PROCESS 4D TAGS can introduce unwanted CR into the processed text. The placement of the 4D TAGS become critical in the control of CR into output text. For example, the code below:

<!--#4DEVAL $i:=0-->
<!--#4DLOOP ($i<8)-->
<!--#4DEVAL $i-->
<!--#4DEVAL $i:=$i+1-->
<!--#4DENDLOOP-->

PROCESS 4D TAGS will produce the following:

¬
¬

¬
¬

¬
¬

¬
¬

¬
¬

¬
¬

¬
¬

¬
¬

¬
¬


To have only one CR between each line the 4D TAGS need to be reconfigured as shown below:

<!--#4DEVAL $i:=0--><!--#4DLOOP ($i<8)-->
<!--#4DEVAL $i--><!--#4DEVAL $i:=$i+1--><!--#4DENDLOOP-->