Node:get-text, Next:, Previous:mark-text-old, Up:Protocol Requests



get-text [25] (1) Recommended


        get-text [25] (( text       : Text-No;
                         start-char : INT32;
                         end-char   : INT32 ))
                -> ( HOLLERITH );

Retrieve text number text from the LysKOM database, starting at position start-char and ending at position end-char. The first character in the text is numbered 0 and the last can be retrieved using get-text-stat. It is also permitted to request a character position beyond the actual end of the text, in which case as much text as is available will be returned.

Example:

        1 25 100 0 32766
        =1 25HYawn^JNothing is happening
        2 25 100 5 32766
        =2 20HNothing is happening
        3 25 100 0 3
        =3 4HYawn

In the example, ^J represents a newline.

In this example, text 100 is requested three times, first from position 0 to position 32766, then from position 5 to position 32766 and finally from position 0 to position 4. The first reply contains the entire text, the following two contain only the requested portion.

Error codes

no-such-text
The text text does not exits or no read permission. This error code will also be used when attempting to fetch texts without logging in first. (There are some texts that are readable without logging in: the motd-of-lyskom (see set-motd-of-lyskom), and texts with the world-readable aux item set on them.)
text-zero
Attempt to retrieve text number 0.
index-out-of-range
start-char is larger than the length of the text.