R rgxrose Unregistered / Unconfirmed GUEST, unregistred user! 2006-01-03 #1 怎么样把一个字节转换成一个字符串.例如:13这是一个字节,怎么转换成字符串'1'和'3'
B bbscom Unregistered / Unconfirmed GUEST, unregistred user! 2006-01-03 #2 procedure TForm1.Button1Click(Sender: TObject); var schar; begin s:='13'; showmessage(s[0]); showmessage(s[1]); end;
procedure TForm1.Button1Click(Sender: TObject); var schar; begin s:='13'; showmessage(s[0]); showmessage(s[1]); end;
R riverqh Unregistered / Unconfirmed GUEST, unregistred user! 2006-01-03 #3 楼上的, s:='13';这句定义,你说是字符串还是字节?呵呵 楼主,可以用 IntToStr() 啊,byte比Integer小,可以强制转换的
M mapwindow Unregistered / Unconfirmed GUEST, unregistred user! 2006-01-03 #4 方法很多哟~~~~~随便写一种吧:::: procedure TForm1.Button1Click(Sender: TObject); var chr1,chr2:string; begin chr1:=''; chr2:=''; chr1:=copy(edit1.Text,1,1); chr2:=copy(edit1.Text,2,1); edit2.Text:=chr1; edit3.Text:=chr2; end; end.
方法很多哟~~~~~随便写一种吧:::: procedure TForm1.Button1Click(Sender: TObject); var chr1,chr2:string; begin chr1:=''; chr2:=''; chr1:=copy(edit1.Text,1,1); chr2:=copy(edit1.Text,2,1); edit2.Text:=chr1; edit3.Text:=chr2; end; end.
S SiWeiLiuLang Unregistered / Unconfirmed GUEST, unregistred user! 2006-01-03 #5 procedure TForm2.Button3Click(Sender: TObject); VAR S1:STRING; S2:STRING; B:BYTE; begin B:=13; S1:=INTTOSTR(B); S2:=COPY(S1,2,1); S1:=COPY(S1,1,1); SHOWMESSAGE(S1);//结果为1 SHOWMESSAGE(S2);//结果为3 end; end.
procedure TForm2.Button3Click(Sender: TObject); VAR S1:STRING; S2:STRING; B:BYTE; begin B:=13; S1:=INTTOSTR(B); S2:=COPY(S1,2,1); S1:=COPY(S1,1,1); SHOWMESSAGE(S1);//结果为1 SHOWMESSAGE(S2);//结果为3 end; end.
D dongejkle Unregistered / Unconfirmed GUEST, unregistred user! 2006-01-28 #7 帮顶! http://www.source520.com 站长开发推广同盟 站长朋友的终极驿站 同时拥有海量源码电子经典书籍下载 http://www.source520.com/search/search.asp "编程.站长"论坛搜索引擎-----为中国站长注入动力!
帮顶! http://www.source520.com 站长开发推广同盟 站长朋友的终极驿站 同时拥有海量源码电子经典书籍下载 http://www.source520.com/search/search.asp "编程.站长"论坛搜索引擎-----为中国站长注入动力!
K kaoleoloi Unregistered / Unconfirmed GUEST, unregistred user! 2006-02-08 #8 帮顶! ╭=========================================╮ 80G海量源代码,控件,书籍全免费狂下不停! http://www.source520.com ╰=========================================╯
帮顶! ╭=========================================╮ 80G海量源代码,控件,书籍全免费狂下不停! http://www.source520.com ╰=========================================╯