调用函数出错
1.错误信息:
Types of actual and formal var parameters must be identical
形参与实参必须一致2.函数定义:
type
  INTARRAY = array of LongInt;function easf1_comStringCountInfo( _strValue: String; var _liRowCnt: LongInt; var _ColCnt: INTARRAY):Boolean3.调用部分:
stPrintvalue : string;
liGyouvalue :Longint;
recPrintletter :INTARRAY;easf1_comStringCountInfo(stPrintvalue, liGyouvalue, recPrintletter);为什么?

解决方案 »

  1.   

    假如在不同的单元中均定义了
    type
      INTARRAY = array of LongInt;
    则DELPHI将其看作两个类型。
    删除其中一个定义。
    例如:
    unit1;
    type
      INTARRAY = array of LongInt;
    function easf1_comStringCountInfo( _strValue: String; var _liRowCnt: LongInt; var _ColCnt: INTARRAY):Booleanunit2:
    type
      INTARRAY = array of LongInt; //错误!删除这儿的定义
    easf1_comStringCountInfo(stPrintvalue, liGyouvalue, recPrintletter);
      

  2.   

    我用 Delphi 7/windows 2000 server sp4,没有看出毛病啊。unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;
    type
      INTARRAY = array of LongInt;type
      TForm1 = class(TForm)
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;    function easf1_comStringCountInfo( _strValue: String; var _liRowCnt: LongInt; var _ColCnt: INTARRAY):Boolean;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
    var stPrintvalue : string;
    liGyouvalue :Longint;
    recPrintletter :INTARRAY;
    begineasf1_comStringCountInfo(stPrintvalue, liGyouvalue, recPrintletter);end;function easf1_comStringCountInfo( _strValue: String; var _liRowCnt: LongInt; var _ColCnt: INTARRAY):Boolean;
    beginend;end.
      

  3.   

    谢谢两位的回复
    windindance(风舞轻扬):
    我确实是在公用UNIT里定义的函数,在另一个UNIT里调用,但只在公用UNIT里定义了那个TYPE.CloneCenter(复制中心):
    我用的环境是Delphi 6/windows 2000 professional sp3
      

  4.   

    我的也没有问题
    d6/windows xp
      

  5.   

    检查一下有没有重复定义,build一下看看。应该就是这个原因,我这儿测试没有问题。
      

  6.   

    查了查,应该是没有重复定义。
    而且,我按住Ctrl点INTARRAY,可以跳到那个公共的UNIT。
    所以我想,用的应该是公共UNIT里的那个TYPE。
      

  7.   

    BUILD一下
    看看搜索目录里面有没有同名的文件
      

  8.   

    问题解决了,谢谢大家,由于USES了很多的UNIT,所以在某一个UNIT里,重复定义了,用了强制引用就好了。
    再次谢谢大家,特别是windindance(风舞轻扬)
    结贴!!!