
Series 3700 System Switch/Multimeter Reference Manual
Section 9
:
Instrument Control Library (ICL)
Document Number: 3700S-901-01 Rev. A / August 2007
9-131
makegetter
Remarks
This function creates a function that when called returns the value of the attribute.
This function is useful for aliasing attributes to improve execution speed. Calling
the getter function will execute faster than accessing the attribute directly.
Creating a getter function is only useful if it is going to be called several times.
Otherwise the overhead of creating the getter function outweighs the overhead of
accessing the attribute directly.
Also see
makesetter
(on page 9-131)
Example
To create a getter function called
getrange
:
getrange = makegetter(dmm, "range")
...
r = getrange()
NOTE
When
getrange
is called, it returns the value of dmm.range.
makesetter
Function
Creates a function to set the value of an attribute.
Usage
setter = makesetter(table, attributename)
table
: Read-only table were the attribute is located.
attributename
: The string name of the attribute.
setter
: Function that sets the value of the given attribute.
Remarks
This function creates a function that when called sets the value of the attribute. This
function is useful for aliasing attributes to improve execution speed. Calling the
setter function will execute faster than accessing the attribute directly.
Creating a setter function is only useful if it is going to be called several times.
Otherwise the overhead of creating the setter function outweighs the overhead of
accessing the attribute directly.
Also see
makegetter
(on page 9-130)
Example
Use
setrange
to set the value of
dmm.range
for the currently selected function:
setrange = makesetter(dmm, "range")
setrange(5)