关于delphi的edt的问题,求助高手!!

来源:百度知道 编辑:UC知道 时间:2024/06/02 16:47:34
假设窗体上有edt1和edt2各1各,我有3组数据,比如说A1代表01,A2代表02,A3代表03,我想把A1A2A3输入到edt1.text里,edt2.text马上显示010203,或者把A2A1A3输入到edt1。那edt2显示020103,有高手会写代码吗。50分求高手写段代码添出来,能简单最好。在这,谢谢了。
要delphi7.0写的代码
图片供参考https://gss0.baidu.com/7LsWdDW5_xN3otqbppnN2DJv/744600600/pic/item/1a3334124c21a6d5c2fd7878.jpg
最好能说下步骤

fucntion GetMyStr(str:string):string;
begin
if str='A1' then
result:='01'
else
if str='A2' then
result:='02'
else
if str='A3' then
result:='03'
else
result:='';
end;

porcedure TForm1.button1Click;
var
str1,str2,str3:string;
begin
str1=copy(edt1.text,1,2);
str2=copy(edt1.text,3,2);
str3=copy(edt1.text,5,2);
edt2.text:=GetMyStr(str1)+GetMyStr(str2)+GetMyStr(str3);
end;

刚装系统没装delphi 帮不上。。。