3. Statements : OpenROAD Language Statements : Method Statement : Example—Method Statement
 
Share this page                  
Example—Method Statement
Define a method that adds the appropriate tax to an attribute “amount”:
method addtax
(tax = float) =
begin
CurObject.amount = CurObject.amount + CurObject.amount*tax;
end;
Define a method that displays a message containing the FirstName attribute of the object in the trace window (no parameters needed):
method printmsg =
begin
CurMethod.Trace(text = CurObject.FirstName);
end;