8.10 Functions

There are several kinds of Vortex functions:

  • Script functions
    Functions written in the script itself, declared with <A nbsp;NAME=name> tags. These are called with named parameters, can modify global variables, and may or may not set $ret .

  • Library functions
    The same as script functions, but stored in the library. We'll discuss them in the section on Vortex nbsp;Library nbsp;Modules .

  • Builtin functions
    Functions inherent to Vortex, such as <fmt> and <sum> . Some builtin functions can have start and end tags, and act as loops, such as <rex> . Builtin functions have a mix of named and unnamed parameters, and only set $ret and other special variables. Builtin functions are always PRIVATE .

  • User functions
    These are C functions written and linked into the Vortex executable, and callable from Vortex. They only affect $ret , always have unnamed parameters, and are always PRIVATE .

Calling

Vortex functions are called in one of two ways:

  1. From inside the script with a tag name, such as <main> .

  2. As the entry function (start point) from the URL, eg. http://www.mysite.com/cgi-bin/texis/example/main.html .

Functions have parameters and a specific scope, discussed below.

Back: Variable Initialization Next: Function Scope
Copyright © 2024 Thunderstone Software LLC. All rights reserved.