一段程序PB的,麻烦大侠们翻译程Delphi(100分)

  • 主题发起人 主题发起人 nfdfst
  • 开始时间 开始时间
N

nfdfst

Unregistered / Unconfirmed
GUEST, unregistred user!
String ls_Inputdata,ls_OutputData,ls_NeedStr<br>ls_OutputData=space(2000)<br>ls_Inputdata='63104|'+CardNo+'|' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>if (QUERY_HANDLE(ls_Inputdata,ls_OutputData)= - 1 ) then<br> messageBox("系统提示","查询信息中心信息系统出错!"+ls_OutputData)<br> return - 1<br>end if<br>ls_needStr=f_spliterstring(ls_outputData,1)<br>&nbsp;if ls_needStr='NULL' then<br>&nbsp; &nbsp; &nbsp; &nbsp; messagebox("系统提示","拆分字符串不成功!")<br>&nbsp; &nbsp; &nbsp; &nbsp; return -1<br>&nbsp;end if<br>&nbsp;if integer(ls_needStr)&lt;0 then<br> &nbsp; &nbsp; &nbsp;messagebox("系统提示","查询不成功!"+ls_OutputData)<br> &nbsp; &nbsp; &nbsp;return -1<br>&nbsp;end if<br>&nbsp;<br>&nbsp;ls_ickh = f_spliterstring(ls_outputData,2)<br>&nbsp; if ls_ickh='NULL' then &nbsp;//卡号<br>&nbsp; &nbsp; &nbsp; &nbsp; messagebox("系统提示","拆分字符串不成功!")<br>&nbsp; &nbsp; &nbsp; &nbsp; return -1<br>&nbsp;end if<br>&nbsp;ls_ickh=trim(ls_ickh)
 
就这么一段代码别人也没有办法帮你翻译吧。。。有很多变量都是没有上下关联的嘛
 
其实我需要的只是怎么给ls_Inputdata 分配两兆的内存,别的都不太重要!我看了很多<br>分配内存的文章,没懂!苯了点!
 
PBlock = ^TBlock; <br>TBlock = record <br>&nbsp; &nbsp; ls_OutputData : array[0..2*sqr(1024) - 1] of Byte; &nbsp;//2M内存 <br>&nbsp; &nbsp; end;
 
/*这是一个Function的片断代码*/<br>//String ls_Inputdata,ls_OutputData,ls_NeedStr<br>var<br>&nbsp; ls_Inputdata,ls_OutputData,ls_NeedStr :string;<br><br>begin<br>//ls_OutputData=space(2000)<br><br>//ls_Inputdata='63104|'+CardNo+'|'<br>ls_InputData := '63104|'+CardNo+'|';<br><br>//if (QUERY_HANDLE(ls_Inputdata,ls_OutputData)= - 1 ) then<br>if Query_HANDLE(ls_Inputdata,ls_OutputData)= - 1 then //Query_HANDLE是自定义函数<br>begin<br>&nbsp;//messageBox("系统提示","查询信息中心信息系统出错!"+ls_OutputData)<br>&nbsp;Application.MessageBox('查询信息中心信息系统出错!'+ls_OutputData,'系统提示');<br>&nbsp;//return - 1<br>&nbsp;return -1;<br>end;<br><br>//ls_needStr=f_spliterstring(ls_outputData,1)<br><br>ls_NeedStr := f_spliterstring(ls_outputData,1); &nbsp;//f_spliterstring为自定义函数<br><br>&nbsp;//if ls_needStr='NULL' then<br>&nbsp;if ls_NeedStr='' then<br>&nbsp;begin<br>&nbsp; &nbsp; &nbsp; &nbsp;// messagebox("系统提示","拆分字符串不成功!")<br>&nbsp; &nbsp; &nbsp; &nbsp;Application.MessageBox('拆分字符串不成功!','系统提示');<br>&nbsp; &nbsp; &nbsp; &nbsp;// return -1<br>&nbsp; &nbsp; &nbsp; &nbsp;return -1;<br>&nbsp;end;<br><br>&nbsp;//if integer(ls_needStr)&lt;0 then<br>&nbsp;if StrToInt(ls_NeedStr)&lt;0 then<br>&nbsp;begin<br>&nbsp; &nbsp; &nbsp; // messagebox("系统提示","查询不成功!"+ls_OutputData)<br>&nbsp; &nbsp; &nbsp; Application.MessageBox('查询不成功!'+ls_OutputData,'系统提示');<br>&nbsp; &nbsp; &nbsp; // return -1<br>&nbsp; &nbsp; &nbsp; return -1;<br>&nbsp;end;<br><br>&nbsp;//ls_ickh = f_spliterstring(ls_outputData,2)<br>&nbsp;ls_ickh := f_spliterstring(ls_outputData,2);<br><br>&nbsp;// if ls_ickh='NULL' then &nbsp;//卡号<br>&nbsp;if ls_ickh='' then<br>&nbsp;begin<br>// &nbsp; &nbsp; &nbsp; &nbsp;messagebox("系统提示","拆分字符串不成功!")<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Application.MessageBox('拆分字符串不成功!','系统提示');<br>// &nbsp; &nbsp; &nbsp; &nbsp;return -1<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return -1;<br>&nbsp;end;<br>&nbsp;//ls_ickh=trim(ls_ickh)<br>&nbsp;ls_ickh := trim(ls_ickh);//这个应该是一个函数的代码,这里也可以写成Result := Trim(ls_ickh);<br><br>end;
 

Similar threads

D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部