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

Adding RAP Passthrough for InputBox

edited May 2003 in RAP
I have added a passthrough function for the InputBox function. It works
great, but when I assign the result to a variable in the OnCreate of the
report an AV pops up. The work around is to assign the result to a Global
variable then assign it to the Variable. Does anyone know why an access
violation occurs? Here is the code for the passthrough with the execute. It
is pretty straight forward.

procedure TRWInputBox.ExecuteFunction(aParams: TraParamList);
var
TempCaption, TempPrompt, TempDefault, TempResult: string;
begin
GetParamValue(0, TempCaption);
GetParamValue(1, TempPrompt);
GetParamValue(2, TempDefault);
TempResult := InputBox(TempCaption, TempPrompt, TempDefault);
SetParamValue(3, TempResult);
end;

The RAP code for calling the function is as follows:

procedure GlobalOnCreate;
begin
Variable1.Value := InputBox('Caption', 'Prompt', 'Default');
end;

Any ideas?

Comments

  • edited May 2003
    I get an error when trying to set Variable1.Value :='SomeString' in RAP when
    the report is exectuing. We'll have to research it. For now, you should be
    able to work around it by setting AsString:

    Variable1.AsString := InputBox('Caption', 'Prompt', 'Default');


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.