ERROR: "Incompatible types:" -- Already RTM
When I use your example;
type
TJCLFileVersionInfo= class(TObject)
...
end;
....
with fsScript1.AddClass(TJclFileVersionInfo,'TObject') do
AddConstructor('constructor Create(const FileName: string)',CallMethodFileInfo);
...
function TfsScriptDM.CallMethodFileInfo(Instance: TObject; ClassType: TClass;
const MethodName: String; var Params: Variant): Variant;
begin
Result := Integer(TJclFileVersionInfo(Instance).Create(Params[0]));
end;
=======
script
program test;
var fi : TJCLFileVersionInfo;
begin
fi := TJCLFileVersionInfo.Create('c:\trek-setup.exe');
Writeln(fi.fileversion);
end.
========
and then when it runs it errors WITH:
Incompatible types: 'Class TJclFileVersionInfo', 'Class TJclFileVersionInfo'
I don't understand why? Looks correct to me.
I reviewed docs and code but couldn't find anything that helps.
Can you point me in the right direction?
Thanks,
Brian
type
TJCLFileVersionInfo= class(TObject)
...
end;
....
with fsScript1.AddClass(TJclFileVersionInfo,'TObject') do
AddConstructor('constructor Create(const FileName: string)',CallMethodFileInfo);
...
function TfsScriptDM.CallMethodFileInfo(Instance: TObject; ClassType: TClass;
const MethodName: String; var Params: Variant): Variant;
begin
Result := Integer(TJclFileVersionInfo(Instance).Create(Params[0]));
end;
=======
script
program test;
var fi : TJCLFileVersionInfo;
begin
fi := TJCLFileVersionInfo.Create('c:\trek-setup.exe');
Writeln(fi.fileversion);
end.
========
and then when it runs it errors WITH:
Incompatible types: 'Class TJclFileVersionInfo', 'Class TJclFileVersionInfo'
I don't understand why? Looks correct to me.
I reviewed docs and code but couldn't find anything that helps.
Can you point me in the right direction?
Thanks,
Brian
Comments
I tried fsGlobalUnit instead of fsScript1 (not documented that way, but)
and it worked.
STILL not sure why my other forum question does not work or why nobody will answer.
Is this common for support ?
Brian