ID : 5063
程序的定义部分
程序的定义部分是指程序编码上的非过程部分。
主要记述变量的定义语句、预处理编码。不能记述定义语句以外的语句。
从任务(程序文件)内的任何过程均可访问通过定义部分定义的局部变量。
以下示例中将局部变量“aaa”和“ccc”记述在定义部分。
<过程名:Pro1>
Dim aaa As Integer
Sub Main
Dim bbb As Integer
End Sub
Dim ccc As Integer
Sub test
Dim ddd As Integer
End Sub
Function eee(ByVal fff As Integer) As Integer
eee = fff * 2
End Function
上述示例中可从过程“Main”开始访问变量“ccc”。
ID : 5063