Data input

For the Sbasic programmers we have added two routines in the Sbasic interface to make the input and editing of strings somewhat easier. In fact these routines are similar to some Window MANager routines, which are however not available through the QPTR interface. These WMAN routines were already available in C and Assembler, and so only the Sbasic interface is explained here. We have however implemented slightly different routines, which can be exited by some more keypresses, and there is also a small difference in the parts of the window that are cleared.


Read string

The given string will be edited in the given window. The entire window width can be used. The string is printed at the current cursor position, and can only use the space between the current cursor position and the right hand side of the window. Only the part to the right of the cursor position is cleared. READstring returns on reading ENTER, ESC, UP arrow, DOWN arrow, tab, shift tab, any function key.

The cursor is positioned at the start of the given string. If the first typed character is printable, then the old string is thrown away. However if the first typed character was SPACE then READstring will treat this as ENTER.

Sbasic
    READstring #ch, string
    ch : Sbasic channel id [1]
    string : updated string
  
errors, code,   meaning
>0              termination character
...             any i/o system error

Edit string

The given string will be edited in the given window. The entire window width can be used. The string is printed at the current cursor position, and can only use the space between the current cursor position and the right hand side of the window. Only the part to the right of the cursor position is cleared. READstring returns on reading ENTER, ESC, UP arrow, DOWN arrow, tab, shift tab, any function key.

The cursor is positioned at the end of the given string so that the string can be edited.

Sbasic
    EDITstring #ch, string
    ch : Sbasic channel id [1]
    string : updated string
  
errors, code,   meaning
>0              termination character
...             any i/o system error
PROGS, Professional & Graphical Software
last edited September 6, 1996