Thunderstone Software Document Search, Retrieval, and Management
Search:
Vortex Manual
 

pragma - inline compiler directive

 

SYNOPSIS

<!-- pragma [name] [value] -->


DESCRIPTION
The pragma directive, unlike any other directive, can appear anywhere in the script, including inside a function. Pragmas typically alter the way code is lexically analyzed, so that the pragma can be applied only to certain code sections if desired. Since they appear in comments, earlier Vortex versions that are not aware of the pragmas will ignore them silently. The pragmas available include:

  • strictcomment on|off Turn on or off strict comment parsing. With strict comments on, comments must start with "<!--", not just "<!"; thus tags such as "<!DOCTYPE>" are directly printable and do not get interpreted as comments. The default is on. Added in version 3.01.986950000 20010410.

  • nestcomment on|off Turn on or off nesting of comments. With nesting on, comments may be nested. The default is off. Added in version 3.01.986950000 20010410.

  • literalprint on|off Whether to allow literal text and/or variable printing. With literal printing off, printing text or variables by simply placing literal text or $-var references in the code is not allowed and will generate the compile error "Literal/variable printing not allowed when pragma literalprint off". Whitespace is still allowed but is silently ignored (instead of being output); comments are also still permitted and ignored.

    Turning off literal printing can be useful in some situations - such as when generating an image - to ensure that all output is being generated by explicit code, e.g. via <fmt>, and no inadvertent whitespace or mistyped code is causing extraneous output.

    The default is on. Added in version 5.01.1223689000 20081010.

  • compilesqlexpressions on|off   Whether to compile SQL expressions into the .vtx object file where possible, rather than interpret them on the fly at run-time. SQL expressions are used in parenthetical variable assignments (e.g. <x = (y + 5)>) and complex <if> statements, amongst other places. Compiling them speeds up script execution, as the original expression then does not need to be re-interpreted by the SQL engine every time the statement is run. The default is the value of the conf/texis.ini setting [Texis] Compile SQL Expressions; if that is unset, the default is on. Added in version 6.01.


EXAMPLE
In this example, nestable comments are turned on. Thus the "print bio of author" comment, which is inside a larger comment, nests properly, and the entire inner <SQL> statement is commented out:

<!-- pragma nestcomment on -->
<A NAME=main>
  <SQL "select Title, Author from books
        where Keywords like $query">
    Title: $Title       <!-- print title -->
    Author: $Author     <!-- print author -->
<!-- this section commented out:
    <SQL "select Details from author
          where Author = $Author">
      Bio: $Details     <!-- print bio of author -->
    </SQL>
  -->
  </SQL>
</A>


SEE ALSO
urlcp


Copyright © Thunderstone Software     Last updated: Thu Dec 22 15:13:31 EST 2011
 
Home   ::   Products   ::   Solutions   ::   How to Buy   ::   Support   ::   Contact Us   ::   News   ::   About
Copyright © 2012 Thunderstone Software LLC. All rights reserved.