Adding RAP Passthrough for InputBox
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?
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?
This discussion has been closed.
Comments
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
http://www.digital-metaphors.com
info@digital-metaphors.com