A.2 Description

A.2.4 ktl read varname ?-binary?


Read the specified keyword, setting the associated global variable and returning the keyword value as the command value.

ktl link must already have been used to link the service and keyword. Usually, varname is the keyword name, but ktl link may have overridden this.

By default the ASCII (external) representation of the value (usually this is what GUIs will want to use) is used, but -binary will force use of the binary (internal) representation.

Numeric values which do not begin with a sign will have a leading space inserted. This is to improve visual effect (a column of left-justified numbers, some of which have signs and some of which don't looks horrible!). This behavior cannot currently be controlled.

The read always blocks on completion (i.e. the only flag currently supported is KTL_WAIT). Time-out intervals are keyword library-specific and are not controllable at this level.

For example:

ktk4.1% ktl link dcs2 instrume
instrume
ktk4.1% puts "instrument is [ktl read instrume]"
instrument is LRIS

Tcl/Tk/KTL Interface - 13 NOV 1996

Generated with Harlequin WebMaker

Back to the Keck Home Page