Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

Can't compile RAP function

edited May 2004 in RAP
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

Comments

  • edited May 2004

    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
  • edited May 2004
    Found it myself -- the Signature did not have a semicolon at the end.

    Jim

  • edited May 2004
    Thanks, Nard. Didn't mean to step on your reply.

    Jim

This discussion has been closed.