类型为 ANY 的变量接收指定给该变量的值的类型。该值可以是基本类型(如 INT),也可以是基于用作类型的数据部件的变量。该值不能是表单或 dataTable。
myInt INT = 1; myString STRING = "EGL"; myAny01, myAny02 any; // myAny01 receives the value 1 and the type INT myAny01 = myInt; // myAny02 receives the value "EGL" and the type STRING myAny02 = myString; // The next statement is // NOT VALID because a variable of type INT // is being assigned to a variable of type STRING myAny02 = myAny01;
以无效方式组合类型的操作只有在运行时才会检测出来,并且会导致程序终止。这些操作包括对不兼容类型的字段赋值、将自变量值传递给不兼容类型的参数或者将不兼容的值合并到一个表达式中。
在引用类型为 ANY 的变量时,访问始终是动态的。固定结构(dataTable、文本表单、打印表单或固定记录)中不能包括类型为 ANY 的字段。
相关参考
基本类型