Contents   Index   Previous   Next



Get and Set functions

Disclaimer: Get/Set Functions only work with PB up to version 6.

To make it easy for you to implement Get- and Set-Functions, SmartPaste includes the ability to select an instance variable of the object you’re currently working on.

This is how it works:

You define a new object function, either a Get- or a Set-Function and define the proper interface for it (Get-Functions yield values, but do not take any arguments, whereas Set-Functions only have one argument and no return value).

By clicking the appropriate button in the SmartPaste Window, Smartpaste shows you a window with all the instance variables of the object. After you have chosen one, SmartPaste automatically inserts the proper code for the function.

Once you become aquainted to SmartPaste, you can also modify the code that’s pasted in by editing the ‚getfunction‘ and ‚setfunction‘ macro in the macro edit window.

To select an instance variable, you use the generic macro ‚selectinstvar‘. This opens the selection window. After you have selected the variable, you can access it by the macros ‚instvar‘ (the name) and ‚instvartype‘ (the type of the instance variable).