ord(50分)

  • 主题发起人 liuxiaohai
  • 开始时间
L

liuxiaohai

Unregistered / Unconfirmed
GUEST, unregistred user!
ord()函数怎么用?
 
delphi在线帮助中的例子:
uses Dialogs;
type
Colors = (RED,BLUE,GREEN);
var
S: string;
begin
S := 'BLUE has an ordinal value of ' + IntToStr(Ord(BLUE)) + #13#10;
S := S + 'The ASCII code for "c"
is ' + IntToStr(Ord('c')) + ' decimal';
MessageDlg(S, mtInformation, [mbOk], 0);
end;
 
ord()的本意是取序号,如字符序号,枚举序号等,如:ord('a')
 
类似于Byte(..),强制类型转换。
 
ord('a') 取ASCII码
 
顶部