调用函数出错
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.错误信息:
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);为什么?
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);
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.
windindance(风舞轻扬):
我确实是在公用UNIT里定义的函数,在另一个UNIT里调用,但只在公用UNIT里定义了那个TYPE.CloneCenter(复制中心):
我用的环境是Delphi 6/windows 2000 professional sp3
d6/windows xp
而且,我按住Ctrl点INTARRAY,可以跳到那个公共的UNIT。
所以我想,用的应该是公共UNIT里的那个TYPE。
看看搜索目录里面有没有同名的文件
再次谢谢大家,特别是windindance(风舞轻扬)
结贴!!!