{{htmlmetatags>metatag-robots=() metatag-title=(PEEK MESSAGE | ugBASIC User Manual) metatag-keywords=(ugBASIC,Commodore 64,Commodore PLUS/4,ZX Spectrum) metatag-description=(Manual page for PEEK MESSAGE) metatag-media-og:image=(:ugbasic:logo-ugbasic-fb.png) metatag-og:title=(PEEK MESSAGE | ugBASIC User Manual) metatag-og:description=(Manual page for PEEK MESSAGE) }} ====== ugBASIC User Manual ====== ===== PEEK MESSAGE ===== ===== SYNTAX ===== = PEEK MESSAGE( portId ) ==== PURPOSE ==== 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. ==== EXAMPLE ==== sessionId = LOGIN( "user", "password" ) port = FIND( sessionId, "user2", "testApp" ) IF PEEK MESSAGE( port ) THEN PRINT "A message is arrived!" ENDIF ==== ABBREVIATION ==== PkMsg ==== AVAILABLE ON ==== * Commodore 64 * Commodore 64+REU * TRS-80 Color Computer 3 * TRS-80 Color Computer ==== ALIAS FOR ==== [[DOJO PEEK MESSAGE]] ==== ANY PROBLEM? ==== If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please [[https://github.com/spotlessmind1975/ugbasic/issues/new?title=ISSUE ON PEEK MESSAGE|open an issue]] for this keyword on GitHub. Thank you!===== POWERED BY ===== [[:ugbasic:user:index|{{ :ugbasic:user:logo-ugbasic.png?nolink&600 |}}]]