FUNCTION Start() AS VOID
LOCAL d AS DWORD
LOCAL n AS INT
d := UInt32.MaxValue
? "d 的初始值:", d
BEGIN UNCHECKED
// 在 UNCHECKED 块内进行的算术运算不会在算术转换和运算中产生溢出异常、
// 无论溢出检查是否在整个应用程序中启用
n := (INT)d
? "转换后的 n 值:", n
d ++
? "d 增加后的值:", d
END UNCHECKED
d := UInt32.MaxValue
BEGIN CHECKED
// CHECKED 块内的算术运算总是进行
// 溢出检查,并在检测到溢出时抛出异常
TRY
n := (INT)d
d ++
CATCH e AS Exception
? "CHECKED 操作中抛出的异常:", e:Message
END TRY
END CHECKED
Console.ReadLine()
RETURN