ML-01 is the main loop routine, which performs the following tasks:
Initializes the message area and port file input flag at the start of every loop.
Performs a complex wait.
Tests the result of the complex wait, as follows: If the result is a timeout, it Restarts the main loop.
If the result is notification of input present in the port file, it:
Reads the port file into the message area.
Sets the port file input flag.
Performs the paragraph SEND-TO-LINC, which passes the message on to the application. This assumes that the message data is already formatted correctly. Refer to SEND-TO-LINC for more information.
If the result is notification of a change of port file status, it performs the paragraph PORT-CHANGE, which handles situations where the port file has been closed or its status has otherwise changed. Refer to PORT-CHANGE for more information.
If the result is notification of a message through COMS, it performs the paragraph GET-COMS-Message, which reads the message, identifies its type, and initiates the appropriate processing. Refer to GET-COMS-Message for more information.
If the result is invalid, it displays the invalid result.
Checks to see if the COMS has instructed the NOF program to close down.