7. Resource Manager - Code Resource

A Code Resource can contain alternating blocks of text and Omnis code. Text blocks can contain variable definitions, comments and plain text (usually parts of the HTML page to be returned to the browser). The plain text can contain embedded expressions. Omnis code blocks, variable declarations, embedded expressions and comments are specified by placing them between special delimiters (<% and %>).

Omnis code execution and text block variable evaluation are carried out as if the code and the variables were contained in an Omnis code class in the plugin library. Macros are compiled by the server when the first request for the Macro is received. Subsequent requests run the compiled Macro.

Calls to other methods in the plugin and references to variables do not need to be qualified with the library name. The following variables can be referenced by the Omnis code or embedded in text:

  • Parameters declared in the Macro Parameter List.
  • Variables declared in text blocks of Code Resources.
  • Omnis hash variables.
  • Variables declared in Omnis file classes in the plugin library.
  • Omnis expressions. e.g: [=con(vParam,':',vOther)]