Const Declarations

<< Click to Display Table of Contents >>

Navigation:  Reference > Declarations >

Const Declarations

GPScript supports integer, floating point, boolean and string constants (more on strings below). For convenience, MIDI note names can be used in place of integers. For example, C3 is the same as 60, D#4 (or Eb4) is the same as 75.

You can declare global constants and local constants. However, at this time, constant expressions are not supported.

 

Const

  AnswerToUniverse : Integer = 42 // No expressions allowed, just single values for now

  SustainCC : Integer = 64 // You can use this in the matching section of a callback

 

Constants can be used in array declarations and in callbacks. For example

On ControlChangeEvent(m : ControlChangeMessage) Matching SustainCC from Keyboard

   // Etc

End

 

 

Consts are allows for integer, boolean, string and double types only. You **can** use a "heredoc" for string constants.