Shiny Language Reference

Language Reference > Basic Language


declare

declare optional_global varname [optional_array_size] vartype;

 

Declares a variable for use

The DECLARE statement declares a variable of the specified type (and optionally as an array) for future use. For further information, refer to the Basic Types reference. This statement is provided for dual-syntax similarities to the Visual Basic "Dim" statement, as the Shiny compiler operates as though the Visual Basic "Option Explicit" setting is used.

 

Parameters

Not applicable

 

Return Value

No return value, this is a statement.

 

Example Code

// Declare an integer variable called MyNumber
declare MyNumber int;

// Declare a global integer variable
declare global MyNumber int;

// Declare a string array with 10 elements
declare MyStringArray [10] string;