home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.whtech.com
/
ftp.whtech.com.tar
/
ftp.whtech.com
/
club100
/
ref
/
titles.doc
< prev
next >
Wrap
Text File
|
2006-10-19
|
1KB
|
48 lines
JUSTIFYING SCREEN TITLES
by Richard Hanson
22-Feb-88
There are times when you will want to justify screen titles either left,
center, right or all three; or whatever combination you wish. The following
is a collection of algorhythms that will accomplish these tasks:
Start by placing your information into variables:
10 A$="left"
20 B$="center"
30 C$="right"
Example of left, center, right justifying:
40 PRINTA$
50 PRINTTAB((40-LEN(B$))/2)B$
60 PRINTTAB(40-LEN(C$))C$
Example of testing the combined length of all variables to be printed on one
line:
70 IFLEN(A$+B$+C$)>=40THEN ...an error should be displayed here, and control
returned to the point of input for A$, B$ & C$.
Example of printing all three justifications on one line:
80 D1=((40-LEN(B$))/2)-LEN(A$)
90 D2=40-(LEN(A$+B$+C$)+D1)
100 PRINTD1;D2
110 PRINTA$SPACE$(D1)B$SPACE$(D2)C$
The above examples were developed with screen printing in mind, i.e., to the
Model 100, 102 or 200's 40 character display. To drive a printout just change
the 40 to the width of your printed page (60, 75, 80 ...whatever) or make it
an input variable.
These instructions are off-the-head, and I'm sure there are other ways to
accomplish the same tasks -- feedback is welcome.
<END>