docs.roxen.comView this page in a printer friendly mode
DocsRoxen2.2Web Site Creator ManualIf Tags
Copyright  2004, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com
 DEMO  DOCS  PIKE
 COMMUNITY  DOWNLOAD
www.roxen.com



<else>
<elseif>
<false>
<if>
<if accept>
<if client>
<if clientvar>
<if config>
<if cookie>
<if date>
<if defined>
<if domain>
<if exists>
<if expr>
<if false>
<if group>
<if internal-exists>
<if ip>
<if language>
<if match>
<if Match>
<if module>
<if pragma>
<if prestate>
<if referrer>
<if sizeof>
<if supports>
<if time>
<if true>
<if user>
<if variable>
<if Variable>
<then>
<true>

<if expr></if>

Provided by module: Tags: RXML 2 tags

This plugin evaluates a string as a pike expression. Available arithmetic operators are +, -, *, / and % (modulo). Available relational operators are <, >, ==, !=, <= and >=. Available bitwise operators are &, | and ^, representing AND, OR and XOR. Available boolean operators are && and ||, working as the pike AND and OR.

Numbers can be represented as decimal integers when numbers are written out as normal, e.g. "42". Numbers can also be written as hexadecimal numbers when precedeed with "0x", as octal numbers when precedeed with "0" and as binary number when precedeed with "0b". Numbers can also be represented as floating point numbers, e.g. "1.45" or "1.6E5". Numbers can be converted between floats and integers by using the cast operators "(float)" and "(int)".


(int)3.14

A common problem when dealing with variables from forms is that a variable might be a number or be empty. To ensure that a value is produced the special functions INT and FLOAT may be used. In the expression "INT()+1" the INT-function will produce 0 if the form variable is empty, hence preventing the incorrect expression "+1" to be produced.


Attributes

expr="expression"

Choose what expression to test.