var str: string;
begin
str := IntToHex(ord('a'), 2);
end;
begin
str := IntToHex(ord('a'), 2);
end;
解决方案 »
- delphi 打开文件,并定位到指定字符串所在位置
- 菜鸟级问题 DELPHI查询组件的时间查询怎么写
- ==========如何编写一个http服务端===============
- combobox只读的小问题
- 在安装一个IMAGE控件时,提示“找不到文件DsgnIntf.dcu”文件,请问怎么解决。、
- 请教一个问题关于TppReport做报表的!急用!谢谢了!
- 如何将报表中生成的内容以word文档的形式保存在指定的文件夹?应用时,只要取得其相对路径,就可以调出该文件
- 请问,Delphi 有类库吗?它的类库在哪里?
- 一个新手的很面的问题
- 请问:如何通过函数/过程返回数组?
- 请问:窗体恢复的消息是什么?
- 语法问题.......简单!
我试了一下,发现str:=IntToHex(ord('a'),2);后
str=‘’
怎么回事??
var
I: Integer;
begin
Result := '';
for I := 1 to Length(mHex) div 2 do
if IsInteger('$' + mHex[I * 2 - 1] + mHex[I * 2]) then
Result := Result + Chr(StrToInt('$' + mHex[I * 2 - 1] + mHex[I * 2]));
end; { HexToStr }function StrToHex(mStr: string): string;
var
I: Integer;
begin
Result := '';
for I := 1 to Length(mStr) do Result := Result + IntToHex(Ord(mStr[I]), 2);
end; { StrToHex }
var
I: Integer;
begin
Result := '';
for I := 1 to Length(mHex) div 2 do
if IsInteger('$' + mHex[I * 2 - 1] + mHex[I * 2]) then
Result := Result + Chr(StrToInt('$' + mHex[I * 2 - 1] + mHex[I * 2]));
end; { HexToStr }function StrToHex(mStr: string): string;
var
I: Integer;
begin
Result := '';
for I := 1 to Length(mStr) do Result := Result + IntToHex(Ord(mStr[I]), 2);
end; { StrToHex }