procedure TForm1.FormCreate(Sender: TObject);
var s,ss:string;
begin
s:='A';
ss:='';
if (ord(s[1]) and $80)=0 then ss:=ss+'0' else ss:=ss+'1';
if (ord(s[1]) and $40)=0 then ss:=ss+'0' else ss:=ss+'1';
if (ord(s[1]) and $20)=0 then ss:=ss+'0' else ss:=ss+'1';
if (ord(s[1]) and $10)=0 then ss:=ss+'0' else ss:=ss+'1';
if (ord(s[1]) and $8)=0 then ss:=ss+'0' else ss:=ss+'1';
if (ord(s[1]) and $4)=0 then ss:=ss+'0' else ss:=ss+'1';
if (ord(s[1]) and $2)=0 then ss:=ss+'0' else ss:=ss+'1';
if (ord(s[1]) and $1)=0 then ss:=ss+'0' else ss:=ss+'1';
memo1.text:=ss;
end;
已测试,无问题,MEMO1显示01000001
你的数据若非字符串,则把ord()去掉