Loading...
 

SendMsg

SendMsg

SendMsg(message)

parameters: Name of a message

Stack
Stack Position Description
Stack(In) Top any
. . .
Stack(Out) Top Return values En
Return values En-1
. . .
. . .
Return values E1
. . .

The action lists of all currently visible window objects, as well as all loaded modules and those that are triggered via .ext (see External Statement), are searched for the message specified as a parameter, the assigned statement sequences are executed immediately, and the receivers see the sender's stack (i.e. all receivers see the stack as it looked like just before the SendMsg statement was executed; a receiver cannot determine whether there were other receivers of the message before him).

SendMsg removes all entries from the stack. When the instruction is finished, return values transmitted with ReturnStack appear on the stack. If several recipients E1, ..., En reply with ReturnStack, the return values are superimposed as shown in the table above. If no recipient responds with ReturnStack, the stack is empty after SendMsg.

SendMsg loads a module described by an external instruction; the message is then sent to the loaded module.

Messages defined in a base module are inherited; the actions associated with the message are triggered unless actions for the same message are overdefined in the derived module. In this case, SendMsg executes the actions in the derived module.
The instruction sequence hidden by the overdefined message can be reached with SendMsg(, SUPER).

SendMsg(STACK)

Stack
Stack Position Description
Stack(In) Top Message
Top 1 any
. . .
Stack(Out) Top Return values En
Return values En-1
. . .
. . .
Return values E1
. . .

The message to be sent can also be specified on the stack:

Msg(OMEGA)
(OMEGA) SendMsg(STACK)

Note: A message as constant must be enclosed in brackets

SendMsg(message, REMOTE)

Stack
Stack Position Description
Stack(In) Top Name of the recipient (as string)
Stack(In) Top 1 any
top 2
top 3 . . .
Stack(Out) Top Return values En
Return values En-1
. . .
. . .
Return values E1
. . .

The message is sent to another ClassiX® application. Before that, the name of the network interface to be used must be set via SetDefaultRemoteMessaging. Up to now, only sending via CORBA has been implemented. According to the ClassiX® convention, the name of the recipient consists of the computer name, IP address, PID, User-ID, logon date (and time) and the name(s) of the database(s), separated by " | ". Example: "HIWI (192.168.1.109) | 2164 | 0 | 2005-3-22 15:29:37 | y:\classix\projects\classix.cxd | y:\classix\projects\classix2.cxd". The name can be changed using functions of the CORBA manager(SetProject, SetName).

See also the EnableDefaultRemoteMessaging, RemoteClients, GetComputerName and GetPID functions of SystemObject. See also: Documentation on the Corba interface of ClassiX®.

The message must be defined in the target application, otherwise the instruction has no effect or causes an error.
As with the local SendMsg, the stack (here from Top-1) is transmitted. Since the values from the stack must be transmitted to another process on another machine, only the entries listed in the following enumeration can be transmitted Other entries on the stack lead to an error.
SendMsg(..., REMOTE) returns immediately. Return values are ignored. The program does not receive any confirmation whether the message was delivered successfully or not.

If NULL or an empty character string is passed as the receiver, it is assumed that the stack is the result of a remote synchronous call via SendMsg (e.g. the CORBA interface SendMsg_CORBA).

SendMsg(..., REMOTE) supported

  • Character string
  • integer values
  • persistent objects
  • persistent Collections
  • Marker (also [, ], COLOR ... )
  • NULL

Analogous to the local form, there is also

SendMsg(STACK, REMOTE)

Stack
Stack Position Description
Stack(In) Top Message
Stack(In) Top 1 Name of the recipient (as string)
top 2 any
top 3
top 4 . . .
Stack(Out) Top Return values En
Return values En-1
. . .
. . .
Return values E1
. . .

billOfMaterial singleAllocation SendMsg(EDIT_BOM_SINGLE_ALLOCATION)

// Somewhere there is another module, which receives this message and does something with it:

EDIT_BOM_SINGLE_ALLOCATION: // Receive the parameters from stack
                            -> singleAllocation
                            -> billOfMaterial
                            // Start editing
                           
EditObject

A message can also be sentdirectly to a window object or module via SendMsg(..., DIRECT) !

See also