城 城里的月饼 Unregistered / Unconfirmed GUEST, unregistred user! 2002-02-08 #1 如: const g=7; ..... 而我要用到: if ( key in ['0'..'7']) then ... 如何将g转换成‘7’。
L lujr Unregistered / Unconfirmed GUEST, unregistred user! 2002-02-08 #3 procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); var strInfor:string; chrA:char; begin strinfor:=inttostr(g); //const g=7; chra:=strinfor[1]; if key in [chra] then showmessage('ok'); end;
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); var strInfor:string; chrA:char; begin strinfor:=inttostr(g); //const g=7; chra:=strinfor[1]; if key in [chra] then showmessage('ok'); end;
Z zjjzl Unregistered / Unconfirmed GUEST, unregistred user! 2002-02-08 #4 BCB内可以这样: 7==>'7': char(7+'0') 即:char(g+'0') Delphi下可以使用ASCI编码转换。