Can't compile RAP function
I am trying to add a function named 'ListName' to the RAP code toolbox, and
when I try to view the Language tab in the code toolbox, I get an error
'Could not compile program: ListName'. I can't see what I'm doing wrong,
it's a very simple function. I've added other functions to RAP successfully,
the only difference is, this one has no parameters. Does anyone see what the
problem is?
unit ReportBuilderProRAPExtensions;
interface
uses
Windows, Classes, SysUtils, Forms, Dialogs,
raFunc, ppRTTI;
type
TRapListName = class(TraUtilityFunction)
public
procedure ExecuteFunction(aParams: TraParamList); override;
class function GetSignature: string; override;
class function HasParams: Boolean; override;
end;
implementation
class function TRapListName.GetSignature: string;
begin
Result := 'function ListName: String';
end;
class function TRapListName.HasParams: boolean;
begin
Result := false;
end;
procedure TRapListName.ExecuteFunction(aParams: TraParamList);
var
Value: string;
begin
Value := 'Test';
SetParamValue(0, Value);
end;
initialization
raRegisterFunction('ListName', TRapListName);
finalization
raUnRegisterFunction('ListName');
end.
Thanks,
Jim
when I try to view the Language tab in the code toolbox, I get an error
'Could not compile program: ListName'. I can't see what I'm doing wrong,
it's a very simple function. I've added other functions to RAP successfully,
the only difference is, this one has no parameters. Does anyone see what the
problem is?
unit ReportBuilderProRAPExtensions;
interface
uses
Windows, Classes, SysUtils, Forms, Dialogs,
raFunc, ppRTTI;
type
TRapListName = class(TraUtilityFunction)
public
procedure ExecuteFunction(aParams: TraParamList); override;
class function GetSignature: string; override;
class function HasParams: Boolean; override;
end;
implementation
class function TRapListName.GetSignature: string;
begin
Result := 'function ListName: String';
end;
class function TRapListName.HasParams: boolean;
begin
Result := false;
end;
procedure TRapListName.ExecuteFunction(aParams: TraParamList);
var
Value: string;
begin
Value := 'Test';
SetParamValue(0, Value);
end;
initialization
raRegisterFunction('ListName', TRapListName);
finalization
raUnRegisterFunction('ListName');
end.
Thanks,
Jim
This discussion has been closed.
Comments
Your GetSignature method needs a ; on the end of the signature string, like
this
'function ListName: String;';
rather than
'function ListName: String';
--
Nard Moseley
Digital Metaphors Corporation
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Jim
Jim