大家帮我看一下我的代码有什么问题,急!!!

fuction 2003-12-12 01:01:48
var
p1,p2:pchar;
a,b:string;
begin

getmem(p1,256);
getmem(p2,256);
a:=data1+'='+data2+'=';
b:=data1+'='+data2+'='+data3+'=';
strcopy(p1,@a[1]);
strcopy(p2,@b[1]);
code:=writecard(n1,n,p1,p2,2);
freemem(p1);
freemem(p2);
end;
...全文
39 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
fuction 2003-12-12
  • 打赏
  • 举报
回复
问题解决了,高兴!来者有分!!!
fuction 2003-12-12
  • 打赏
  • 举报
回复
可是我的系统提示说是内存错误,这是怎么回事啊!!!
chinajavis 2003-12-12
  • 打赏
  • 举报
回复
建议设置断点调试一下是什么错误
sundayboysII 2003-12-12
  • 打赏
  • 举报
回复
建议修改StrCopy的函数参数:
StrCopy(P1, Pchar(a));
StrCopy(P2, PChar(b));
qiume 2003-12-12
  • 打赏
  • 举报
回复
// 应该没什么问题
var
p1,p2:pchar;
a,b:string;
begin

getmem(p1,256);
getmem(p2,256);
try
a:=data1+'='+data2+'=';
b:=data1+'='+data2+'='+data3+'=';
strcopy(p1,@a[1]);
strcopy(p2,@b[1]);
code:=writecard(n1,n,p1,p2,2); // writecard对吗?
finally
freemem(p1);
freemem(p2);
end;
end;
VeryOldMan 2003-12-12
  • 打赏
  • 举报
回复
你的代码没什么问题呀。
检查以下你的writecard()函数吧。

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧