LOCAL Command

Creates local variables and variable arrays. There are two versions of the syntax.

LOCAL Var1 [ AS type [ OF ClassLib ] ] | [ ArrayName1( nRows1 [, nColumns1 ] ) [ AS type [ OF ClassLib ] ] ]
    [, Var2 [ AS type [ OF ClassLib ] ] | [, ArrayName2( nRows2 [, nColumns2 ] ) [ AS type [ OF ClassLib ] ] ]
LOCAL [ ARRAY ] ArrayName1( nRows1 [, nColumns1 ] ) [ AS type [OF ClassLib ] ]
    [, ArrayName2( nRows2 [, nColumns2 ] ) [ AS type [ OF ClassLib ] ] ]

Parameters

LOCAL VarList

Specifies one or more local variables to create. Use commas to separate multiple items in VarList.

The single letters A through J and M are reserved and cannot be used as variable names.

[ ARRAY ] ArrayName1( nRows1[, nColumns1 ] ) [, ArrayName2( nRows2[, nColumns2 ] ) ] ...

Specifies one or more local arrays to create. For more information about arrays, see DIMENSION Command.

[ AS type[ OF ClassLib] ]

Specifies the data type of the variable or array and the class library containing the type description of type on which this variable or array is based.

When you specify a valid class name, Visual FoxPro uses the type library, if you specify a ProgID Property (Visual FoxPro), or instantiates an object to get a list of properties, methods, and events. If the specified class name is not found, Visual FoxPro displays a list box of available classes.

You can use the AS clause to implement strong typing. IntelliSense functionality is available for object and variable references only when they are strongly typed. For more information, see How to: Implement Strong Typing for Class, Object, and Variable Code.

Expand imageRemarks

Expand imageSee Also


© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic