الرئيسية > lang > localdecl 
 en fr de es it nl pl pt pt_BR mk sq ca hu cs tr fa id vi ko ja ru zh zh_TW eo
السابق  التالي  تحرير  إعادة تسمية  تراجع  بحث  الإدارة  
المستندات  
تحذير! هذه الصفحة لم يتم ترجمتها.  See english version 
Local Variable Declaration
DIM Identifier AS Datatype [ = Expression ]

Declare a local المتغير in a procedure or function.

This variable is only accessible to the procedure or function where it is declared.

مثال

DIM iVal AS Integer
DIM sName AS String
DIM hObject AS Object
DIM hCollection AS Collection

Initialization

The المتغير can be initialized with any expression.

مثال

DIM bCancel AS Boolean = TRUE
DIM Languages AS String[] = [ "fr", "it", "es", "de", "ja" ]
DIM DefaultLanguage AS String = Languages[1]

Alternatively, you can initialize the variable with a newly instanciated object.

DIM Identifier AS NEW Class ( Arguments ... )

DIM aTask AS NEW String[]
DIM aCollection AS NEW Collection(gb.Text)

Or you can initialize the variable with a native dynamic array. See Array Declaration for more information.

Multiple Declarations

You can declare several variables on the same line:

مثال

DIM Text AS String, Matrix AS NEW Float[3, 3]
DIM X, Y, W, H AS Integer

إنظر أيضا

Array Declaration, Using reserved keywords as identifiers, الإعلان عن متغير, أنواع البينات, إتفاقيات التسمية