调用自编的方法时,为什么会报错?

laobalu 2005-07-19 07:04:51
提示是[Error] umain.pas(128): This form of method call only allowed for class methods
请问这是为什么?
方法的代码及调用代码如下:
function TMainForm.convertunixeproctime(rawtime: string):int64;
var
raw:tdatetime;
begin
raw:=strtodatetime(rawtime);
result:=datetimetounix(raw);
end;


procedure TMainForm.btnSiteRankQueryClick(Sender: TObject);
var
inittime:string;
convertedtime:int64;
begin
inittime:=cbbYear.Text;
convertedtime:=tMainForm.convertunixeproctime(inittime);
end;
...全文
52 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
laobalu 2005-07-20
  • 打赏
  • 举报
回复
自己搞定了,感谢楼上两位。给分了
lovend 2005-07-19
  • 打赏
  • 举报
回复
帮你顶
vpoor 2005-07-19
  • 打赏
  • 举报
回复
convertedtime:=convertunixeproctime(inittime);

16,748

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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