SD_POS/IOW_SCUR etc
These traps set the position of the cursor.
Trap | Value in D0.B | Action |
SD_POS/IOW_SCUR | $10 | Set cursor using character co-ordinates |
SD_TAB/IOW_SCOL | $11 | Set cursor to the horizontal character position |
SD_NL/IOW_NEWL | $12 | Set cursor to start of next line |
SD_PCOL/IOW_PCOL | $13 | Move cursor to previous character |
SD_NCOL/IOW_NCOL | $14 | Move cursor to next character |
SD_PROW/IOW_PROW | $15 | Move cursor to previous line |
SD_NROW/IOW_NROW | $16 | Move cursor to next line |
Call Parameters | Return Parameters |
D0.B | See above | D0.L | Corrupted? |
D1.L | Column number | D1.L | Corrupted. |
D2.L | Row number | D2.L | Preserved. |
D3.W | Timeout | D3.L | Preserved. |
A0.L | Channel ID | A0.L | Preserved. |
Errors
ERR_NC | Not complete. |
ERR_NO | Channel not open. |
ERR_OR | Position out of window |
Notes
All registers not shown above are not used on entry and are preserved on exit.
The value in D1 is only relevant for SD_POS/
IOW_SCUR and SD_TAB/
IOW_SCOL.
The value in D2 is only needed for SD_POS/
IOW_SCUR.
Any pending newline is cancelled by these traps.
If there is an error the cursor position is unchanged.
SD_NL/
IOW_NEWL will return "out of range" if the cursor is at the bottom of the window.
Example
The example below shows the use of this trap call to place the cursor to a particular character position in the window. It is assumed that A0 contains the channel ID.
place moveq #-1,d3 ; Timeout
moveq #4,d1 ; To the fifth character . .
moveq #6,d2 ; . . on the seventh line
moveq #sd_pos,d0 ; $10
trap #3 ; Set the cursor
tst.l d0 ; OK? . .
bne error ; . . no!