Sign in Join
Wiki copytemporary

Revision 1 of 1, by Trev on 3-3-2020. The page as it is now.

Var/zh CN

Var是用于标明变量及其数据类型声明部分的关键字。当其在过程或函数的参数列表中使用时Var表示使用可变参数(即按引用传递参数)。

变量通常声明在以下关键字之前 program, procedure, function 或者 unit.

pascal
var
  age: integer;

如果您打算使用相同数据类型的多个变量,这些变量可以被归组以表明它们具有共同的类型定义。这些变量必须使用,comma分隔。

pascal
var
  FirstName, LastName, address: string;

参见


From the Free Pascal wiki, page "Var/zh CN", as it stood on 2020-03-03 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.