The GET MESSAGE
statement allows you to retrieve the message present on the
specified port (port
), and possibly on the specific channel (channel
).
If used as a function, the message is returned as a string; otherwise,
the type of the given variable is used to parse the incoming type. If there are
no messages at the time of the call, or if the port is unknown, an empty string
will be returned or the given variable is untouched. The actual
error must be retrieved with the DOJO ERROR
command. If you want to avoid
fetching a message from an empty message queue, you can use the PEEK MESSAGE
statement.
Note that MESSAGE
keyword is optional.
= [DOJO] GET [MESSAGE]( port[, channel] ) [DOJO] GET [MESSAGE] port[, channel], variable
message = GET MESSAGE( myPort, myChannel ) DIM a(42): GET MESSAGE myPort, 42, a
Join BASIC 10Liner Contest with ugBASIC!
An interesting competition is held at the beginning of each year: the
BASIC 10Liner Contest.
It is possible to use ugBASIC to participate in the next
"BASIC10Liner" competition, in the following categories:
GET MESSAGE ↔ GeMa
If you have found a problem with this keyword, if you think there is a bug or, more
simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!
open an issue
BACK TO KEYWORDS