Available on: c64 c64reu coco3 coco
Alias: DOJO PEEK MESSAGE

PEEK MESSAGE

The PEEK MESSAGE function can be used to wait for a message on a DOJO port. The function returns FALSE if the the message port is empty. On the contrary, if it returns TRUE, it is possible to fetch the message using the GET MESSAGE command.

Note that the message port behaves like a queue, that is, the first message that is inserted is the first that is retrieved. Therefore, if a program sends three messages in a row to the attention of the port of another, the receiving program will receive the three messages in the same order. Obviously, if several programs do the same thing, the messages will be interspersed but, in the end, they will be in the same order.

SYNTAX

 = PEEK MESSAGE( portId )


Legend
  • id : identifier
  • type : datatype
  • v : value
  • "..." : string
  • [...] : optional

EXAMPLE

 sessionId = LOGIN( "user", "password" )
 port = FIND( sessionId, "user2", "testApp" )
 IF PEEK MESSAGE( port ) THEN
    PRINT "A message is arrived!"
 ENDIF


ABBREVIATION: PkMsg

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:

  • PUR-120 - A game in 10 lines of max 120 characters (w/abbrev.)
  • EXTREME-256 - A game in 10 lines of max 256 characters (w/abbrev.)
  • SCHAU - Any program in 10 lines of max 256 characters (w/abbrev.)
In order to reduce space you can use this abbreviation for this instruction:

PEEK MESSAGE ↔ PkMsg

Any problem?

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