![]() quick server pages |
#if - #elseif - #else - #endifAlter execution flow of control based on a conditional expression. #if statements can be nested.if and endif are required. elseif and else are optional. An example of an if construct:
#if @mode = A <h4>Mode is A</h4> #elseif @mode = B <h4>Mode is B</h4> #else <h4>Mode not given</h4> #endif More examples:
#if @tag = TOTAL #if @meas > 0.0 && @meas < 8.5 #if @name = "" #if @type like "west*" || @type = "bl*" #if $arith(@A+@B) > 10 #exitTerminate interpretation of the template immediately. Any content encountered up to the #exit will be displayed. Example:
#if @_DEBUG = 1 #exit #endif #includeInclude script code from a file. filename may be relative to your project ./pages dir; if not found there filename will be used directly. Includes may be nested. It is often very useful to have all of the pages in a project #include a common header at the top, and a common footer at the bottom. #include is also useful in sharing template code chunks that are utilized in more than one page, and for encapsulating external URL references that are used in more than one place.Usage: #include file
#included code is interpreted in the same manner as ordinary code.
However, #break and #continue
may be used only if the corresponding loop / #endloop is also within
the included file. #return
may be used to immediately exit the included file and resume execution
in the including file.
#returnTerminate execution of an #included file immediately. Execution is resumed in the including template, at the statement immediately following the #include.
Usage: #return
|
![]() quick server pages Copyright Steve Grubb |