SendMsg(..., DIRECT)

SendMsg(message, DIRECT)

Parameter: Message name

Stack
Stack Position Description
Stack(In) top window object or module
  top-1 any
  top-2 . . .
Stack(Out) top -

The message indicated as a parameter is immediately sent to the stack top window object / module. The receiver will be passed in the stack (see application widget / module). In case the receiver is a window object, the message will be sent to this window object, not to its child objects. In case the receiver is a module, the message will be sent to the module and to all associated window objects.

// At the start, send the message with the widget to response to!
Button(CreateObjectBtn, 10, 10, 100, 8, T("Objekt erstellen", "Create object"))
[
 
SELECT        : Widget SendMsg(CREATE_OBJECT) // The command "Widget" puts the actual button on the stack.
 
OBJECT_CREATED: -> newObject
                  T(
"Objekt wurde erstellt!", "Object was created!") Attention(EndTXN)
]

// Somewhere there is another module, which receives this message and does something with it:
CREATE_OBJECT: // Receive parameters from stack
              
-> sender
             
 // Call the macro, which creates the object
             
 CreateObject
             
 // Send the message only to the sender! No broadcasting at all.
               // No other module will recognize this message!
              
createdObject sender SendMsg(OBJECT_CREATED, DIRECT)

See also