Object Pascal 允许在const 和Var声明时用编译期间的函数,这些函数包括Ord()、Chr()、Trunc()、Round()、High()、Low()和Sizeof()。例如,下列所有代码都是合法的:
Type
A = Array[1..2] of Integer;
Cont
w: word = SizeOf(Byte) ;
Var
i : Integer = 8;
j :SmallInt = Ord('a');
L : LongInt =Trunc(3.14159);
B1 : Byte = high(A);
B2 : Btye = Low(A);
C : Char = Chr(46);