Current Help System: PC-DMIS BASIC (View Core Help)

### 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.

See "Dim Statement" for more information.

Note: 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.