SecondBASIC Documentation v3

Home / Command Reference / Dim, Local

Dim, Local

Description: Sets the dimensions of a variable to the local scope.

Syntax:

Dim <Variable> As <DataType> [* <Size> | At <Location>]
Local <Variable> As <DataType> [* <Size> | At <Location>]

Part Description
<Variable> Required. This is the name of the variable.
<DataType> Required. This sets the Data Type of the variable
<Size> Optional. This is only for String Data Types. The asterisk (*) is required.
<Location> Optional. Sets the default value of the variable. <Location> is the line label where the data statements are located.

Example:

        Dim a As Integer, b$ As String, c& As Long
        ' Integer Array loaded up with default values
        Local d(4) As Integer At MyInts
 
        For i = 0 To 4
                Print d(i)
        Next
 
MyInts:
        DataInt 11,12,13,14,15