Functions.EnableArrayIndexCheck 方法 | |
Suppress Array Index check to be compatible with Visual Objects
In some situations Visual Objects did not throw a runtime error when you were accessing a non existing array element.
You can enable this (mis)behaviour in X# by disabling the array index checks.
The default behavior is to generate an error when you access array indices out of the existing range.
命名空间:
XSharp.RT
程序集:
XSharp.RT (在 XSharp.RT.dll 中) 版本:2.22 GA
语法 FUNCTION EnableArrayIndexCheck(
lCheck AS LOGIC
) AS LOGIC
public static bool EnableArrayIndexCheck(
bool lCheck
)
查看代码参数
- lCheck
- 类型:Boolean
TRUE to enable the array index checks.
返回值
类型:
BooleanThe previous setting of the flag
示例
// The following code does not throw a runtime error but displays NIL for u[1,1]
// To get the same behavior in X# you need to call EnableArrayIndexCheck(FALSE)
FUNCTION Start
LOCAL u AS USUAL
u := {1,2,3}
? u[1,1]
WAIT
RETURN TRUE
参见