Macro: SEND

Module location: FMACDD line 10322 (view source)

Changes: 1. support "OF" as well as "TO". OF is preferred 2. Check location of "OF" keyword 3. Check for improper message type (expression) 4. If sent directly within class (not method)...error

  #IF ( (!Zl & 1)=0)
    // we expect message to be msg_xxx, constant or local var.
    // Actually locals are wierd, but much more acceptable
    #IFCLASS !1 "EFWV" // if exp, file, window or global...wierd
      #ERROR 302 Unusual Usage: Variable or Expression used as message
    #ENDIF

    #IF (!b = 2) // within class but not in object or method
      #ERROR 302 Messages in class should be in method
    #ENDIF
  #ENDIF

  #DATA
  #IFDEF !1
    #DPUSH !1
  #ELSE
    #IFDEF MSG_!1
      #DPUSH MSG_!1
    #ELSE
      #DPUSH |CI0
      #FREF MSG_!1 !a,0
    #ENDIF
  #ENDIF
  #IFSAME !2 TO OF // support both OF (suggested) and TO (old)
    SEND$HELP !4 !5 !6 !7 !8 !9
    SEND$CMD TO TO !3
  #ELSE
    SEND$HELP !2 !3 !4 !5 !6 !7 !8 !9
    SEND$CMD TO TO CURRENT_OBJECT
  #ENDIF