{{getMsg('Help_YouAreHere')}}:
/
{{page.title}}
{{page.title}}
{{$root.getMsg("downLoadHelpAsPdf")}}
{{helpModel.downloadHelpPdfDataStatus}}
Variable declaration operators
Basic Syntax:
Variable "formula"
To specify the return value of a formula a value must be assigned to the variable formula at the end of each formula. Otherwise, the formula is erroneous.
Dim x As Number x = 5 formula = x
Variable Declaration
Dim x ' single variable without defined type Dim x () ' array variable without defined type Dim x As //(type)// [range] ' single variable with type (type), optional a range of type (type) Dim x () As //(type)// [range] ' array variable with type (type), optional an array of ranges of type (type)
Declares a variable of type (type). The keywords Local, Global, and Shared can be used instead of Dim to select the scope of this variable.
The following declarations are possible:
-
Dim x
-
Dim x As Boolean
-
Dim x As Currency
-
Dim x As Currency Range
-
Dim x As Date
-
Dim x As Date Range
-
Dim x As DateTime
-
Dim x As DateTime Range
-
Dim x As Time
-
Dim x As Time Range
-
Dim x As Number
-
Dim x As Number Range
-
Dim x As String
-
Dim x As String Range
-
Dim x()
-
Dim x() As Boolean
-
Dim x() As Currency
-
Dim x() As Currency Range
-
Dim x() As Date
-
Dim x() As Date Range
-
Dim x() As DateTime
-
Dim x() As DateTime Range
-
Dim x() As Time
-
Dim x() As Time Range
-
Dim x() As Number
-
Dim x() As Number Range
-
Dim x() As String
-
Dim x() As String Range
Crystal Syntax:
Variable Declaration
Local //(type)//Var [range] [array] x
Declares a variable of type (type). The keywords Global and Shared can be used instead of Local to select the scope of this variable. With the optional flags [range] and [array] you can create ranges or array of the selected type and scope. Arrays of range values are possible as well.
The following declarations are possible:
-
<Scope> BooleanVar x
-
<Scope> BooleanVar array x
-
<Scope> CurrencyVar x
-
<Scope> CurrencyVar array x
-
<Scope> CurrencyVar range x
-
<Scope> CurrencyVar range array x
-
<Scope> DateVar x
-
<Scope> DateVar array x
-
<Scope> DateVar range x
-
<Scope> DateVar range array x
-
<Scope> DateTimeVar x
-
<Scope> DateTimeVar array x
-
<Scope> DateTimeVar range x
-
<Scope> DateTimeVar range array x
-
<Scope> TimeVar x
-
<Scope> TimeVar array x
-
<Scope> TimeVar range x
-
<Scope> TimeVar range array x
-
<Scope> NumberVar x
-
<Scope> NumberVar array x
-
<Scope> NumberVar range x
-
<Scope> NumberVar range array x
-
<Scope> StringVar x
-
<Scope> StringVar array x
-
<Scope> StringVar range x
-
<Scope> StringVar range array x