Macro: OBJECT$PROPERTIES
#DATA
#IFDEF !2 // is message in a variable?
#DPUSH !2 // yes, just push the value
#ELSE
#IFDEF !1_!2 // is this message defined?
#DPUSH !1_!2 // yes, push the definition
#ELSE
#DPUSH |CI0 // forward reference the message
#FREF !1_!2 !a,0 // add the reference to be defined
#ENDIF
#ENDIF
#PUSH !Zg
#SET ZG$ 0
#PUSH !Zh
#SET ZH$ 2 // 3 unrestricted params following TO and TO is optional
#IF (!Zl & 1)
#SET ZH$ 3 // Its ok...no fancy checking
#ELSE
#IFSAME !1 GET
#SET ZH$ 1 // 1 means 1 param following TO
#ELSE
#IFSAME DFLT$2$!2 __2__ // is this a complex set message? (more than 1 param)
#ELSE
#IFSAME DFLT$!2 __X__ __F__ // is this a item or form type message?
//#IFSAME DFLT$!2 __F__ // is this a item or form type message?
#SET ZH$ 1 // 1 means 1 param following TO
#ENDIF
#ENDIF
#ENDIF
#ENDIF
PROPERTY$HELP !4 !5 !6 !7 !8 !9
#POP ZH$
#POP ZG$
// Precedence of Object ID resolution
// 1. If variable (hopefully local)
// 2. if expression
// 3. If .obj (old style, to be avoided)
// 4. If object access id
#IFDEF !3 // if a variable, constant or expression...it's defined
OBJECT$DEFINE !1 !3
#ELSE
#IFDEF !3.OBJ // old style: If global object or defined w/ .obj (ugh)
OBJECT$DEFINE !1 !3.OBJ
#ELSE
#IFDEF GET_!3 // if defined as a function
#IF (GET_!3>$40000000) // and an object access method
// this is where we can get tricky and use access methods
#IFDEF USE$NEAR$OBJECT
OBJECT$DEFINE !1 (obj(GET_!3))
#ELSE
OBJECT$DEFINE !1 (!3(Current_object))
#ENDIF
#ELSE // if defined as a function but not an access method. This is an error
#ERROR 300 Invalid Object reference
#ENDIF
#ELSE
// not yet defined. We could either forward ref as object or
// declare an error. For now let's just do an error.
#ERROR 300 Invalid Object reference
// here is how we would forward ref as obj
//Register_object !3
//!A [] OBJ$!1 (!3(Current_object)) |VL
#ENDIF
#ENDIF
#ENDIF