Name
SendMessage -- send message to a message port (V5.0)
Synopsis
SendMessage(port$, cmd$[, ...])
Library
event

Function
This function sends the command specified in cmd$ to the message port specified in port$. The command specified in cmd$ must not contain any space characters. Additionally, you can send an unlimited number of arguments to the message port. Just pass them as optional arguments after the command name. The optional arguments must be passed as strings.

The port specified in port$ must have been created previously by a call to CreatePort(). Please remember that port names are case sensitive, i.e. "MYPORT" and "myport" denote two different message ports. For style guide reasons, port names are usually in upper case only.

The message will be sent to the specified message port in form of a OnUserMessage event that will be forwarded to the callback you specified when installing this event handler using InstallEventHandler().

Note that the strings passed to this function in the optional argument mustn't contain binary data, i.e. the NULL character isn't allowed. If you need to send binary data, you can use Base64Str() to convert the binary data to text and then pass the Base64 text to this function.

Inputs
port$
name of the port you want to address
cmd$
the command(s) you want to send to that port
...
optional: additional string arguments to send to the port; must only contain text, no binary data is allowed
Example
See CreatePort


Show TOC