Skip to content

utillib

A message port is where a program receives messages from other programs or from the system, for example from ARexx. CreateMsgPort makes one; with a name, other programs can find it, as the host port of an ARexx program. Wait puts the program to sleep until a signal comes, so that it uses no time while it waits for messages.

port.l=CreateMsgPort("MYHOST")
; ... receive messages, for example with RexxEvent(port)
DeleteMsgPort port

Ports the program does not delete are deleted when it ends.

Based on the utillib guide by Acid Software.

Library number 194.

Commands

CreateMsgPort

Makes a message port and returns its address; without memory for it, this is the error “Failed to allocate memory for Port”, and without a free signal of the program “Failed to allocate signal for Port”. With a name in PortName$, the port is public and other programs can find it by that name; with an empty name it is private.

Function, result .l. Help text: *UserPort.port=CreateMsgPort(PortName$)
Arguments: $

DeleteMsgPort

Deletes a message port made with CreateMsgPort.

Statement. Help text: *UserPort
Arguments: .l

The messages still waiting at the port are replied first, so that their senders get them back. With runtime error checking, an address that is not a port of CreateMsgPort is the error “Port Not Created By CreateMsgPort”; without it, such an address corrupts memory.

TaskName$

The name of the task or process at the address task; 0 is the program’s own task.

Function, result $. Help text: task
Arguments: .l

A task without a name gives the empty string.

Wait

Waits until one of the signals the program has, such as those of its message ports and windows, comes. As a function, it returns the signals that came.

Statement or function, result .l. No help text.
No arguments.