Text Manipulations

See all articles from Sinc-Link v3 n6
Author(s): Steven Pocock
Publication: Sinc-Link
Pub Details: Sinc-Link v3 n6 (Volume 3, Issue 6)
Date: November/December 1985
Pages: 2

Listed below are four routines that will manipulate text to enhance text presentation in a program.

Peter McMullin‘s expanding text line program (prints from the center outwards) is listed in lines 199-340. Printing only one line of 32 chr$ is somewhat restrictive so a second subroutine (lines 19-105) is used so that any length of text can be printed to the screen. The “set up 32 chr$/line” subroutine partitions the text, in this case stored in array A$ into 32 chr$ per line and stores this subset as Q$. Lines 65 and 105 then call a print subroutine; let ZZ=199 for center outwards printing; ZZ=499 for left to right printing and ZZ=600 for right to left printing. For a better description of the set up routine see Sync Vol 2 #6,p62.

Left to right printing prints text flush to the left hand margin. (left justified). I found that printing right to left however didn’t look as nice when the last partial line of text was left justified so lines 602 and 603 will position any partial line of text in the center of the screen. To make text left justified change line 603 to “IF LEN Q$<31 THEN LET Q$=Q$+L$(TO (31-LEN Q$))”. L$ only needs to be 15 spaces for centering text and 32 spaces for left justified print. When using left to right printing if you don’t like the looks of the last partial line of text being left justified then insert the equivalent of lines 602 and 603 before line 500.

Text manipulation routines listing
Text manipulation routines listing