SendMsg(message)
Parameter: Message name
| 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 the ones that are triggered via ext. (see Extern statement), are searched for the message, which executes assigned statement sequences straight away. The receivers will see the sender stack (all receivers see the stack how it looked right before executing the statement SendMsg; a receiver cannot detect, whether there have been other message receiver before).
SendMsg removes all entries from the stack. After ending the statement, return values that have been passed with ReturnValue appear in the stack. In case more receivers E1, ..., En reply with ReturnValue, the return values will lay on top of each other. In case no receiver reacts with ReturnValue, the stack is empty after SendMsg.
With SendMsg, a module which has been described via Extern statement gets loaded; the message will then be sent to the loaded module.
Messages that have been defined in a basic module are inherited; actions that have been connected with the message are triggered, unless there are overwritten actions in the derived module. In this case, SendMsg executes the actions in the derived module. The statement sequence that has been hidden behind the overwritten message can be reached with SendMsg(, SUPER).
SendMsg(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 can also be predefined in the stack:
Msg(OMEGA)
(OMEGA) SendMsg(STACK)
Information: A constant message has to be encompassed by brackets
| Stack | Position | Description |
|---|---|---|
| Stack(In) | top | receiver name (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 will be sent to another ClassiX® application. Before, it is necessary to set the name of the network interface to be used via SetDefaultRemoteMessaging. So far, only the sending via CORBA has been implemented. According to ClassiX® conventions, the receiver name consists of computer name, IP address, PID, user ID, login date (and time) and database name(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".
Compare SystemObject functions EnableDefaultRemoteMessaging, RemoteClients, GetComputerName and GetPID. See also: ClassiX® CORBA Interface Documentation.
This message has to be defined in the target application. Otherwise the
statement has no effects or causes a mistake. Just like in the local SendMsg,
the stack will be passed (here starting with top-2). Since stack values have to
be passed to another process on another machine, only the entries in the
following listing can be passed. In case something else is in the stack, this
will lead to an error.
SendMsg(..., REMOTE) returns immediately. Return values will be ignored. The
program gets no response, whether the message has been delivered
successfully or not.
If ZERO or an empty string are passed as the receiver, it is assumed, that the stack is result of a distant synchronous call via SendMsg (e.g: the CORBA interface SendMsg_CORBA).
SendMsg(..., REMOTE) supports
Analog to local form, there is also
SendMsg(STACK, REMOTE)
| Stack | Position | Description |
|---|---|---|
| Stack(In) | top | message |
| Stack(In) | top-1 | receiver name (as string) |
| top-2 | any | |
| top-3 | ||
| top-4 | . . . | |
| Stack(Out) | top | return values En |
| return values En-1 | ||
| . . . | ||
| . . . | ||
| return values E1 | ||
| . . . |
A message can be sent directly to a window object or module via SendMsg(..., DIRECT)!
See also