Communication Flags for User Code

Qedit also provides the user interface and PROC routines with the the following powerful control capabilities:

  • Control can pass between PROC routines and user command interfaces without a user prompt by Qedit.
  • PROC routines can request that Qedit add a new line after the current line.
  • PROC routines can divide a single line into two lines.
  • PROC routines can splice two lines into a single line.

These capabilities are provided through a “flags” word appended to the PROCSPACE. This word contains flags for requesting special actions and status replies from Qedit. The flags word is located at PROCSPACE(26) in SPL (PROCSPACE(27) in FORTRAN).

The bits are defined as:

Bit 15: No-prompt-flag. Command input must be provided totally by the User Command-interface routine. “/” is not printed.

Bit 14: Add-line-flag. PROC requests that Qedit create a new blank line immediately following the current line. Control returns to the PROC routine after the add, with the original line.

Bit 13: Add-failed-flag. On the next call to PROC following an “add-line” request, this bit will be turned on if the add failed due to insufficient line numbers.

Bit 12: Restart-line-flag. If you return from a user PROC with this bit set and you return TRUE as the result and not Control-Y, Qedit resets your data buffer to the original contents of the line and calls you again.

Split: If you turn on the add-line-bit and use the “split index” word, PROCSPACE(27) in SPL or PROCSPACE(28) in FORTRAN, you can emulate the function of Control-V in Modify. The value of “split index” defaults to -1, which causes Qedit to create a blank new line (ordinary add-line). Or you can specify how many bytes of the current buffer to retain for the current line and how many to transfer to the new line. Split index equal to zero will move all of the data buffer to the new line and leave the data buffer with length = 0. Split index greater than zero retains the first “split index” bytes in the current and moves the remainder to the next line. The current line is not updated by add-line. Therefore, you can use the restart-bit to recall the previous contents. After an add-line, the PROC routine is still called with the current line, then with the new line.

Bit 11: Splice-line bit. PROC routines may splice the next line to the current line by setting bit 11 to 1, then returning with a TRUE result and LEN set to the true length of their data buffer. Qedit performs the splice function AND updates the current line, then calls the PROC routine for that line again.

Bit 10: Extended-ASCII bit. Qedit turns this bit on when the user has done Set Editinput Extend ON. This indicates that the user would like to be able to use the Roman-8 extensions to the ASCII character set (codes 161 through 254).

Communication Flags for User Code