首页 > def > variable 
 en fr de es it nl pl pt pt_BR mk sq ca hu cs tr ar fa id vi ko ja ru zh eo
前一个  下一个  编辑  重命名  撤销  搜索  管理  
文档  
警告! 该页面未翻译。  参见英文版 
variable
A variable is a symbol associated with an object or a method that can be either read or written.

Each variable must have a datatype. i.e. String, Integer, etc.

A variable can be public, private or local.

Only classes written in Gambas can declare public variables.

A variable is faster to access (because it accesses memory directly for reading and writing its value) than a property, but you have no control on it.

In order to use a variable you must declare it either in the beginning of the class or in the beginning of the procedure.

In VB Variables can be declared "inside" the code.

Beware that variables whose datatype is Object, any array, or any class, are initialized with NULL.

You must initialize them with a real object created with the NEW keyword before using them.

参见

Variable Declaration, Local Variable Declaration, Object Model