procedure TMainForm.FormCreate(Sender: TObject);
var
  i:Integer;
  FNFoxpro,FNSql,AppPath:String;
  procedure FillFoxTableInfo(TableName:TTNList);
  begin
  ...
  end;
begin
  FillFoxTableInfo(TableName);
end;编译时
---------------------------
Debugger Exception Notification
---------------------------
Project DataMove.exe raised exception class EAccessViolation with message 'Access violation at address 00493955 in module 'DataMove.exe'. Read of address 0000000C'. Process stopped. Use Step or Run to continue.
---------------------------
OK   Help   
---------------------------
请问这是怎么回事呢?谢谢

解决方案 »

  1.   

    when the form is creating ,
    the controls on the form is not created yet,
    so you can't use them.
      

  2.   

    or maybe the procedure "FillFoxTableInfo" can't reside in the var directive.procedure TMainForm.FormCreate(Sender: TObject);
    begin
      FillFoxTableInfo(TableName);
    end;procedure FillFoxTableInfo(TableName:TTNList);
    var
      i:Integer;
      FNFoxpro,FNSql,AppPath:String;
    begin
      ...
    end;
      

  3.   

    原因好像并不在这里,我现在已经调试好了
    在procedure FillFoxTableInfo(TableName:TTNList);
    里我定义了很多记录类型,其中有一个里面的个TParameter型的量
    后来把TParameter也变成了一个自定义记录类型,问题就解决了。
    但是这又是什么原因呢?