Sign in Join
Wiki copytemporary

Var/zh CN: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Var/zh CN

OldNewLine
1+Var是用于标明变量及其数据类型声明部分的关键字。当其在过程或函数的参数列表中使用时Var表示使用可变参数(即按引用传递参数)。
2+
3+变量通常声明在以下关键字之前 [[Program|program]], [[Procedure|procedure]], [[Function|function]] 或者 [[Unit|unit]].
4+
5+``` pascal
6+var
7+ age: integer;
8+```
9+
10+如果您打算使用相同数据类型的多个变量,这些变量可以被归组以表明它们具有共同的类型定义。这些变量必须使用,[[Comma|comma]]分隔。
11+
12+``` pascal
13+var
14+ FirstName, LastName, address: string;
15+```
16+
17+## 参见
18+
19+- [[Local variables]]
20+- [[Global variables]]
21+- [[doc:ref/refse19.html|Variable declaration]]
22+- [[doc:ref/refse21.html|Thread Variables]]
23+
24+---
25+*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](/wiki-contact).*

Back to history