You create a user-defined function by using a function definition.
To create a user-defined function:
Choose KB Workspace > New Definition > function-definition
function-name ( [argument] [,...] ) = (expression)
When you close the text editor, G2 attaches a rectangle representing the new function definition to the mouse. Click on any workspace to place the definition on that workspace. G2 transfers the definition rectangle to the workspace at the point of the click, and displays the text of the function in the rectangle. You can click the definition to edit it, display its table, transfer it to a different workspace, or delete it.
area function:
area (x, y) = x * y
![]() |
if area (the length of floor-1, the width of floor-1) > 25 then
inform the operator that
"The area of floor-1 is greater than 25 square feet."