3 Configuration Script Interpreter
steve-px edited this page 2026-03-05 12:36:10 +00:00

Return to Index


When creating configuration files, you have the ability to do some more advance things with the console system. The commands and rules listed in this section will not work on the command prompt line.

Comments, Comment-Blocks

Syntax:

//  (...)
/*  (...)  */

You can add comments to your configuration scripts. These comments can be either single like, or a comment block.

Examples:

// This is a single line comment.

/*  This is a comment-block and can span
     multiple lines.  */

Labels

Syntax: <LabelName>:

You can define labels in your configuration file. Labels can be used with pre-processor commands. Labels can only contain digits (0-9) and alpha-numeric characters (a-Z) and must start with an alpha-numeric character. Labels cannot contain special character such as quotes or double-quotes and cannot contain spaces. The label must end with a colon (:) and must be defined on its own line, with nothing following it (except for a comment or comment block, they are allowed)

Example:

REGVAR a INT 0           // Register a variable 'a', with value 0
LOOP:                    // The label “LOOP”
  ECHO "Counter: $a"     // Prints out the value of variable 'a'
  STORE "$a + 1" a       // Increments the variable 'a' by 1
  #JMPIF "$a < 10" LOOP  // Conditional jump to the label 'LOOP'

Note: You don't need to indent the lines after a label, but it's visual more readable.

Line-Break Operator ("\")

Syntax: (...) \ (ENDL)

When you have a long line in a configuration script, you can break up this line by using single backslash at the end of the line to signify to the Configuration Script Interpreter that the line continues to the next line. The backslash must immediately be followed by the next-line character (so, nothing should follow, even spaces or tabs).

Example:

This is not a command but a sentence, but I hope \
    it demonstrates what I mean \
    with this backslash thing.

Unconditional Exit Operator (#EXIT)

Syntax: #EXIT

End the execution of the configuration script, exiting without any conditions.

Conditional Exit Operator (#EXITIF)

Syntax: #EXITIF <String: Condition>

Ends further execution of the configuration file script if the condition resolves “true”. You can use console variable in the expression. The condition must be written as a JavaScript condition.

Example:

#EXITIF "$cv_var_a == 0"

Go To Sub-Routine Operator (#GOSUB)

Syntax: #GOSUB <Label>

GOSUB, or "Go to subroutine", jumps to a label in a configuration file. You can jump back to the original location with #RTS (Return from subroutine)

Example:

(…)
#GOSUB MyLabel
(…)
MyLabel:
  (…)
  #RTS    // Return to the #GOSUB and resume from there.

Unconditional Jump Operator (#JMP)

Syntax: #JMP <Label>

Jumps to a specified label in the configuration file.

Example:

#JMP SomeLabel

Conditional Jump Operation (#JMPIF)

Syntax: #JMPIF <String: Condition> <Label>

Jumps to a specified label in the configuration file when the condition resolves to true. You can use console variables in the expression. Use JavaScript syntax for the condition.

Example:

#JMPIF "$cv_var_a == 0" SomeLabel

No Operation Operator (#NOOP)

Syntax: #NOOP

The NOOP operator command does nothing. It stands for “NO-OPeration”. You can use it, but there's no point, as it literally does nothing.

Internally, it does have a function: when labels in configuration scripts are converted to addresses (or line number positions), the labels are replaced with #NOOP, so that they won't get picked up by the Configuration Interpreter on runtime.

As a script writer, there is absolutely no reason why you should use this operator.


Return to Index