LanguageUpdated 2026-07-24

Definitions and constants in GPC

Use define declarations and built-in identifier constants without confusing textual names with runtime variables.

Overview

Definitions give readable names to values used throughout a script. They are compile-time declarations, not mutable runtime storage.

Controller identifiers and other built-in constants depend on the target and current Zen Studio documentation. Prefer official names over unexplained numeric literals.

Key facts

  • define declarations appear before runtime blocks.
  • A definition cannot be changed while the script runs.
  • Built-in identifier availability can vary by target and software version.

GPC syntax examples

Examples are intentionally small. Replace identifiers only with values documented for your target.

Readable thresholdexample.gpc
define PRESS_POINT = 80;

main {
    if (get_val(XB1_A) > PRESS_POINT) {
        // threshold reached
    }
}

Functions, commands, and terms

Names below are catalog entries, not guessed signatures. Open the official sources for current parameter and return-value details.

NameKindPurpose
definedeclaration

Associates a compile-time name with a value.

TRUEconstant family

Built-in truth value used by conditional expressions.

FALSEconstant family

Built-in false value used by conditional expressions.

PVAR_*constant family

Identifiers for global persistent-variable positions.

SPVAR_*constant family

Identifiers for slot-private persistent-variable positions.

Common mistakes

Trying to assign to a define name.

Using an undocumented numeric controller ID.

Assuming every legacy identifier exists on current Zen firmware.

Official GPC sources

Use these first-party references to confirm exact syntax and runtime behavior for your installed firmware and Studio version.

Related GPC references