Menu

keywords-var

Will Pittenger

Overview

This keyword lets you declare any data location except compiler constants (see const) and conditional compilation variables (see conditional, conditionalif, and [Conditional compilation]). More information on its use can be found at [The basics (pun intended)].

Use to declare local and global variables

\var\ /type/ identifier [= intialvalue]

/type/ is any type descriptor. See Type descriptors for more information.

Use to declare a data member in a class, structure, or structure-based enum

This is the same as above except for the addition of the access qualifiers and the option static keyword.

(\public\|\protected\|\private\) [\static\] \var\ /type/ identifier [= initialvalue]

If you don't initialize it here, you should initialize it in your constructor.

Use to declare a procedure parameter

This is the same as a local or global variable, except you can't initialize it in the declaration. Rather, declare a custom keyword and query it with an if to detect whether or not it was passed, If it wasn't, initialize it then.

``whatever comes before this parameter`` \var\ /type/ identifier ``whatever comes after this parameter``

Related

Wiki: Appendices-Terms-Type descriptors
Wiki: Appendices-Terms-r-value
Wiki: Conditional compilation
Wiki: Keywords
Wiki: Members and methods
Wiki: The basics (pun intended)
Wiki: keywords-byvalue
Wiki: keywords-conditional
Wiki: keywords-conditionalif
Wiki: keywords-const
Wiki: keywords-expression
Wiki: keywords-out
Wiki: keywords-readonly
Wiki: keywords-ref
Wiki: keywords-static
Wiki: operators-brackets
Wiki: operators-can-be-null