Ordinal type 的操作及Delphi System 提供的编译期函数

Delphi Sysem提供的编译期函数

(Dec,Inc,Pred,Succ,Ord,Chr,Low,High,Sizeof)

Dec:将参数的值递减1或一个特定的值,其中特定值可在第二个可选参数中定义。

Inc:将例程中参数的值递增1或一个特定的值

Odd:如果参数为奇数则返回 真。

Pred:根据参数在其数据类型定义中的序列,返回参数值的前驱值。

Succ:返回参数的后继值。

Ord:返回参数值在其数据类型值集合中的序号

Chr:取得 Ascll码对应的字符。

Low:返回参数对应的有序数据类型的最小值。

 

 

Ordinal types include integer,character,Boolean,enumerated,and subrange types.

Several predefined functions operate on ordinal values and type identifiers.

Hiah,Low,Pred,Succ,Ord

使用举例如下

代码如下:

procedure TForm1.Button1Click(Sender:TObject);

begin

    edit1.Text:=pred('b');

    edit2.Text:=inttostr(succ(5));

    edit3.Text:=inttostr(high(Byte));

end;

 

转载于:https://www.cnblogs.com/chenJazz/p/5712186.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值