<<

Contents

Search

>>

 

SEND_MESSAGE

 

 

Function

 

 

Syntax:

SEND_MESSAGE(<Username of Receiver>, <Computername of Receiver>, <Programname of Receiver>, <Sender>, <Message> [,<Sound File>, <Repeat>[,<Transfer Sound File>[,<Terminate>]]])

 

<Username of Receiver>

= <STRING-EXPRESSION>

<Computername of Receiver>

= <STRING-EXPRESSION>

<Programname of Receiver>

= <STRING-EXPRESSION>

<Sender>

= <STRING-EXPRESSION>

<Message>

= <STRING-EXPRESSION>

<Sound File>

= <STRING-EXPRESSION>

<Repeat>

= <NUM-EXPRESSION>

<Transfer Sound File>

= <NUM-EXPRESSION>

<Terminate>

= <NUM-EXPRESSION>

 

 

Meaning:

Sends a message over the Ebus-2T-Server.

 

By <Username of Receiver>, <Computername of Receiver> and <Programname of Receiver> the receivers of the message are specified. With each of these parameters the empty string "" can be specified as well. The empty string means all user names, all computer names or all program names.

 

The message is sent to all programs that fulfill the conditions <Username of Receiver>, <Computername of Receiver> and <Programname of Receiver>, except of the sending program. (A message cannot be sent to itself!)

 

If <Sender> <> "", the following line is inserted before the message:

 

         Message from <Sender>

 

<Message> specifies the text of the message. The variable EBUS_LINEFEED$ creates a line wrap in the text.

 

With the receiver a window is displayed with the <Message> that has to be confirmed by pressing the OK button.

 

As <Sound File> a file name or a URL address can be specified. If <Transfer Sound File> = 0 the Client must be able to access the <Sound File>.

 

If <Transfer Sound File> <> 0, the <Sound File> is tranferred to the client computer.

 

If a <Sound File> is specified, the <Sound File> is played with the receiver. If <Repeat> <> 0, the <Sound File> is repeated until the receiver presses the OK button.

 

Attention: In Html Programs <Sound File> has no effect.

 

If <Terminate> = 1, all progams that receive the message are terminated.

 

SEND_MESSAGE returns the number of the receivers who got the message.

 

SEND_MESSAGE returns –1 if an error occurred.

 

This function is only available with 2T programs under Java, otherwise it returns the result –1.

 

Parameter:

Username of Receiver

Specifies the username of the receiver. The username is the name returned by the function GET_USERNAME$. No case sensitivity.

 

Computername of Receiver

Specifies the computer name of the receiver. The computer name is the name returned by the function GET_COMPUTERNAME$. No case sensitivity.

 

Programname of Receiver

Specifies the name of the program to which the message is to be sent (e.g. Faktura-2T). No case sensitivity.

 

Sender

Name of sender

 

Message

Message text

 

Sound File

Is played with the receiver.

 

Repeat

<> 0: The sound file is repeated until the receiver presses the OK button.

= 0: The sound file is played once.

 

Transfer Sound File

<> 0: The sound file is transferred to the client computer.

 

Terminate

= 1: All programs that receive the message are terminated.

 

Sample:

/* Send message to all invoice programs

ANZAHL% = SEND_MESSAGE("","","Invoice_2T","Administrator",

          "Please terminate all programs immediately!" + EBUS_LINEFEED$ +

          "Backup has to run.")