这个过程为什么写的不对?unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, DBTables;type
  TForm1 = class(TForm)
    Query1: TQuery;
  procedure ww(queryx:tquery;xx:string);
  private
    { Private declarations }
  public
    { Public declarations }  end;var
  Form1: TForm1;implementation
 procedure TForm1.ww(queryx:tquery;xx:string)
 begin
  with queryx do
  begin
  close;
  sql.Clear;
  sql.Add(xx);
  open;
  end;
 end;
{$R *.dfm}end.
 提示出错[Error] Unit1.pas(25): ';' expected but 'BEGIN' found
怎么回事?

解决方案 »

  1.   

    >>procedure TForm1.ww(queryx:tquery;xx:string);//分号
      

  2.   

    不好意思,小弟确实很菜;还有一个问题!就是我调用的时候,
    procedure TForm1.FormCreate(Sender: TObject);
    var
    ss:string;
    begin
    ss:='select * from zggl order by xh';
     tform1.ww(query1,ss);
    end;end.
    出错,[Error] Unit1.pas(45): This form of method call only allowed for class methods
    为什么?
      

  3.   

    tform1.ww(query1,ss)这行不对,改为:
    form1.ww(query1,ss);
      

  4.   

    >>tform1.ww(query1,ss);
    直接ww(query1,ss)
    或 Form1.ww(query1.ss);
    tform1是类,Form1是Tform1类的对象/实例.
      

  5.   

    tform1.ww(query1,ss);错了..应该是直接写ww(query1,ss);在别的From中调用时才写成 form1.ww(query1,ss);
    还得把你的过程声明放入定义窗体的PUBLIC中去......