Delphi ord 函数1 ord 函数 Returns nbsp the nbsp ordinal nbsp value nbsp of nbsp an nbsp ordinal type nbsp expression 返回一个序数类型表达式的序数值 nbsp Example uses nbsp Dialogs type nbsp nbsp nbsp Colors nbsp nbsp RED BLUE GREEN var nbsp nbsp S nbsp string nbsp begin nbsp nbsp nbsp S nbsp nbsp BLUE nbsp has nbsp an nbsp ordinal nbsp value nbsp
1.ord()函数:
Returns the ordinal value of an ordinal-type expression.
返回一个序数类型表达式的序数值;
Example:
2.在delphi中只可以ord(英文)不可以ord(汉字)请问如何在delphi中实现对汉字ascii码的获得小生不才,望高手赐教,在此谢过!!
答:
procedure TForm1.FormCreate(Sender: TObject);
var
a: string;
begin
a := ‘啊’;
S howMessage(IntToStr(ord(a[1])));
ShowMessage(IntToStr(ord(a[2])));
end;
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/218758.html原文链接:https://javaforall.net