=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Command: Function Message {FOR Class} {Type Argument} RETURNS Type Parameters: Description: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= JJT-5.1 #COMMAND FUNCTION R HANDLE$MESSAGE GET_!1 !2 !3 !4 !5 !6 !7 !8 !9 #ENDCOMMAND =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Command: HANDLE$MESSAGE Message { FOR Class } { RETURNS Type } { Type Argument } Parameters: Description: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= JJT-5.1 #COMMAND HANDLE$MESSAGE RGOBL# #IFDEF UI.EXISTS #ELSE USE UI #ENDIF #IF (!b & 4) #ERROR 100 Procedures and Functions may .not. be nested. #ENDIF #CHECK NUM_ARGUMENTS _T #PUSH !Zg #PUSH !Za #SET ZA$ !a #PUSH !Zu #DATA #STKSYM // forget all old stack symbols #SET B$ (!b | 4) // set flag to in_procedure #REPLACE NUM_ARGUMENTS |SI0 // define the arg count #IFSAME !2 GLOBAL #DPUSH |CI0 // No message #DPUSH |CI0 // for no class #CHECK !1 T // cant have dups of these globals #SET ZG$ (0-!a-2) // make it negative to distuinguish it #REPLACE !1 |CI!Zg // this will cause all fwd refs to be fixed. #IF (!0>1) // do we have arguments? #SET ZG$ 1 // starting argument number DEFINE_ARGUMENTS !3 !4 !5 !6 !7 !8 !9 #ENDIF #FREG !1 !2 !3 !4 !5 !6 !7 !8 !9 #ELSE #IFSAME !2 FOR // are we explict about the class? MESSAGE$ADDRESS !1 // create id symbol for this message #DPUSH !1 #IFDEF !3 #IFSAME !3 DESKTOP #DPUSH U_DESKTOP // Message for the desktop class #ELSE #DPUSH !3 // Message for the named class #ENDIF #ELSE #CHECK U_!3 RSDNU // check the class for goodness #DPUSH U_!3 // Message for the named class #ENDIF #IF (!0>3) #SET ZG$ 1 // starting argument number DEFINE_ARGUMENTS !4 !5 !6 !7 !8 !9 #ENDIF #FREG !1 !4 !5 !6 !7 !8 !9 #ELSE #IF (!b & 2) // obj_flag == in_class? MESSAGE$ADDRESS !1 // yes, same as handle "for" #DPUSH !1 // the message #DPUSH U_!$ // handle msg for "current class" #ELSE #IF (!b & 1) // in_object, instance method !A [] CLONE$CLASS MESSAGE$ADDRESS !1 // yes, same as handle "for" #DPUSH !1 // the message #DPUSH |CI0 // handle for objects class #ELSE // just your simple global message #DPUSH |CI0 // No message #DPUSH |CI0 // for no class #CHECK !1 T // cant have dups of these globals #SET ZG$ (0-!a-2) // make it negative to distuinguish it #REPLACE !1 |CI!Zg // this will cause all fwd refs to be fixed. #ENDIF #ENDIF #IF (!0>1) // do we have arguments? #SET ZG$ 1 // starting argument number DEFINE_ARGUMENTS !2 !3 !4 !5 !6 !7 !8 !9 #ENDIF #FREG !1 !2 !3 !4 !5 !6 !7 !8 !9 #ENDIF #ENDIF // !A [] HANDLE$FOR |CI0 |VL // handle the message !A [] $0454 |CI0 |VL #FREF OBJ$!Za$ENDPROC !a // fref the end procedure line #SET ZG$ 0 // starting argument number for locals #ENDCOMMAND
#IFDEF !1
#ELSE // assign the next message number now
#SET ZC$ !ZC
// #IF (!Zc>$0FFF)
#IF (!Zc>$0FFFFFFF) // using 32-bit msg ids now (256M total allowed)
#ERROR 100 Maximum number of message/property definitions exceeded
#ELSE
#REPLACE !1 |CI!Zc // this will cause all fwd refs to be fixed.
#ENDIF
#ENDIF