traprogram / travariableValue
Hi,
I have to modify RAP-Programs in Code (RB 10, Delphi 7), e.g.
I have to do something in the OnDrawCommandClick-Event of a component by
calling a pass-through function.
I declared this function as function abc(aComponent: tppComponent):
boolean;
depending on the result-value of this function, i want to do something else
in the script, so i have to delcare a local variable for this new script.
Since here, I do like this:
lCodeModule := raGetCodeModule(ppReport1);
lProgram:= lcodemodule.GetEventHandlerForComponent(self..Label1,
'OnDrawCommandClick');
if lProgram = nil then begin
lProgram:= lcodemodule.CreateEventHandler(self.Label1,
'OnDrawCommandClick');
lProgram.BodyText:= 'lb_ok:= abc(Label1);
end;
....
May anyone explain me, how to declare local variables for the program ?
Thanks
Marion
I have to modify RAP-Programs in Code (RB 10, Delphi 7), e.g.
I have to do something in the OnDrawCommandClick-Event of a component by
calling a pass-through function.
I declared this function as function abc(aComponent: tppComponent):
boolean;
depending on the result-value of this function, i want to do something else
in the script, so i have to delcare a local variable for this new script.
Since here, I do like this:
lCodeModule := raGetCodeModule(ppReport1);
lProgram:= lcodemodule.GetEventHandlerForComponent(self..Label1,
'OnDrawCommandClick');
if lProgram = nil then begin
lProgram:= lcodemodule.CreateEventHandler(self.Label1,
'OnDrawCommandClick');
lProgram.BodyText:= 'lb_ok:= abc(Label1);
end;
....
May anyone explain me, how to declare local variables for the program ?
Thanks
Marion
This discussion has been closed.
Comments
Access the TraProgram.Source property to see and alter the entire routine.
This includes the signature, declarations, and body.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I just knew about BodyText. is there any further documentation about the
Objects, their properties and methods ? I just used rbwiki and rap.hlp and
didn't really find, what I was searching for....
Marion
Yes the documentation in this area of RAP can be sparse. We will try to
improve it in the future.
The following rbWiki article uses the TraProgram.Source property to alter
RAP functions.
http://www.digital-metaphors.com/rbWiki/RAP/Fundamentals/How_To...Modify_RAP_Programs_in_Code
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
The RAP demos installed with the product include examples that use the
TraProgram BodyText and Source properties. Check out examples 41 and 42 of
the main RAP demo. Moving beyond the demos rbWiki is great resource.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com