Release 5.  Copyright ©1994-1998 by TipTop Software, Inc.  All Rights Reserved.




TTInterpCode: OBSOLETE!




Inherits From: TTExecutor
Conforms To: TTInteractorProtocol
Declared In: <ObjAppKit/TTInterpCode.h>





Class Description

The code object is used to store a piece of code to be interpreted by an interpreter.  This code is automatically executed in the specified interpreter when the -awakeFromNib message is received, if the execOnAwake flag is set.  The code is also evaluated when the -executeCode: method is explicitly invoked.

Code execution is performed from -runModal: which invokes -evaluate:interactor:debugger:scope:otherFlags: in the interpreter.  If flags showError or showResult are set, the error or result code returned by the eval method is displayed in an alert panel.

This class is useful for storing pieces of code directly in a NIB file.  The code can then be automatically evaluated when the NIB file is loaded, or when an explicit -executeCode: action message is sent.

Note: You cannot use this mechanism to define classes which are instantiated in the NIB file, because it is not possible to ensure that a TTInterpCode object defining a class is loaded before the instance of the class.

Note: You can also associate code directly with interpreter instances in the NIB file.  See UsingIB.rtfd.




Method Types

auxObject
awakeFromNib
delayed
execOnAwake
executeCode:
setAuxObject:
setDelayed:
setExecOnAwake:
setShowError:
setShowResult:
showError
showResult




Instance Methods

auxObject
auxObject

Returns the auxiliary object.




awakeFromNib
  (void)awakeFromNib

If the execOnAwake flag is set, and the code has not yet been evaluated, method -executeCode: is invoked.

See also:  -setExecOnAwake:




delayed
(BOOL)delayed

Returns YES, if exec-on-awake is delayed.




execOnAwake
  (BOOL)execOnAwake

Returns YES if the code will be executed when the object receives -awakeFromNib.

See also:  -setExecOnAwake:




executeCode:
  executeCode:sender

Evaluates the code.  The receiver's -runModal: method is invoked, which uses the interpreter's -compileAndLoad:scope:otherFlags: and -invoke:arguments:interactor:debugger:scope:otherFlags: methods to evaluate the code.




setAuxObject:
(void)setAuxObject:o

Sets the auxiliary object.




setDelayed:
(void)setDelayed:(BOOL)f

If f is YES, when code is executed on awake, it is not executed immediately during awake, but instead the execution is delayed until the current event is finished.




setExecOnAwake:
  (void)setExecOnAwake:(BOOL)f

Sets the execOnAwake flag.

See also:  -execOnAwake




setShowError:
  (void)setShowError:(BOOL)f

Sets the showError flag.

See also:  -showError




setShowResult:
  (void)setShowResult:(BOOL)f

Sets the showResult flag.

See also:  -showResult




showError
  (BOOL)showError

Returns the value of showError flag.

See also:  -setShowError:




showResult
  (BOOL)showResult

Returns the value of showResult flag.

See also:  -setShowResult:



###