ReJump


Chapter 7:: Manual:: ReJump DataFile
Technology



 


Home

Datafile
About
News
Manual
<...
Chapter 7
...>
Download
Contacts








Branching <IF>

Depending on some conditions we want or don't want to input the information into templates.

There is construction "IF" for that aims in the templet language
Its syntax:
<IF expression number_marker>
code, if expression is true
<ELSE number_marker>
code, if expression is false
<ENDIF number_marker>

If expression is true, information since <IF> till <ELSE> will be put into template.
If expression is false, information since <ELSE> till <ENDIF> will be put into template.
"Number_marker" is a number which links between each other thre parts <IF><ELSE> and <ENDIF>. It allows to use embedded expressions "IF" and find these markers in code quite easily.

All parts of construction could be in different lines or in one line. Their placement doesn't matter.

You can use following expressions:

Expression <IF> is true if it doesn't equal "0" and doesn't empty sequence - "{}" or empty line "".

Examples:
<IF <&data-guestbook:mes> 1>Messages<ELSE 1>No messages<ENDIF 1>
We'll recieve "Messages" if <&data-guestbook:mes> returns nonempty sequence. We'll recieve "No messages" if result is {}.

<IF <&data-guestbook-0--mes?Value> 1> checks up file "0.mes" contents on zero.

To verify if there is value in the form we use expression of the form <IF $i.name>. Here "name" - parameter's name in the form.

It is possible to use the following record <IF smth=smth number_marker>
Example: <IF <&data-guestbook:mes>=<&data-guestbook:mes1> >. At that both values are calculating. Then they compare one with the other (as two lines). Only one operator = (equal) is realized on that phase.

Index
Download
Contacts
If you have any questions, please, contact us via email: datafile@rejump.com.


© 2002-2009 Алексей Мась, ReJump