我是刚学Delphi的,我在试着写一个程序的时老出错,代码如下
...
uses
...
type
  TMainForm = class(TForm)
  ...
private
  ...
end;type
  CallDevice = function():integer;stdcall;
end; //系统提示这里有错:‘IMPLEMENTATION’expected but ';' foundvar
  MainForm: TMainForm;implementation
  ...  

解决方案 »

  1.   

    声明在TMainForm下面 
    type
      TMainForm = class(TForm)
      CallDevice = function():integer;stdcall;
    private
      ...
    end;
      

  2.   

    如果这条语句是与TMainForm平级的,就放在TMainForm那一行的上边,
    如果是从属于TMainForm的,就放在TMainForm的Public部分中.
      

  3.   

    把它放在:
    implementation下面
      

  4.   

    type
      CallDevice = function():integer;stdcall;  <-------这个位置
      TMainForm = class(TForm)