Declaration of Variables

In Cypress Enable variables are declared with the Dim statement. To declare a variable other than a variant the variable must be followed by As or appended by a type declaration character such as a % for Integer type.

For Example:

Sub Main
    Dim X As Integer
    Dim Y As Double
    Dim YourName$, YourAge%         ' multiple declaration on one line Dim v
End Sub

Notice that the variables YourName and YourAge use a symbol to declare the variable type instead of the term As. For details, see the topic "Dim Statement" for more information.

While it may be possible in some cases to use variables without declaring them with the Dim statement first, doing so is not supported in Enable BASIC and may cause problems in your code.

Your variable name should not match any reserved word or constant. For information on constants, see "Enumerated Constants Overview". To view a list of other reserved words, see "Functions, Statements, Reserved words - Quick Reference".