From: cohen@GOMEZ.phys.virginia.edu
Subject: Sidewriter (XB program)
Reply-To: cohen@GOMEZ.phys.virginia.edu
Organization: Dept. of Physics, University of Virginia
Date: Tue, 5 Jan 1993 23:08:41 GMT

Here is another piece from the Freenet.  Hope some of you find i useful...
If you really want to print sideways from Multiplan, I would advise getting
the program MP-Sideways (I think it was sold by Quality 99) or the fareware
program Side*Print, they are more elaborate and will do a better job there.
But for fun, the following XB program might work out.


Article 79 of freenet.sci.comp.ti.news:
Newsgroups: freenet.sci.comp.ti.news
Subject: SIDEWRITER
Date: Sun, 23 Sep 90 13:16:50 GMT

     MAKE YOUR PRINTER PRINT SIDEWAYS!!

Have you ever wished that you could print text or tables sideways on the paper
(that is, with the text reading vertically instead of horizontally)? The
following two programs will enable you to do this on an Epson/Gemini compatible
printer.  The method uses the bitmap graphics mode of the printer.

First you must create the data statements that give the printer the codes for
each letter turned on its side.  They can't be typed in because they are mostly
control characters.  The first program creates a mergeable file for XB for all
of them.  The letters created will look exactly like the ones on your screen
(i.e. small letters are actually small caps) unless you put in CALL CHAR
statements before line 100.  This newsletter should also contain a program
which you can type in which gives the same ones as are in the CHARA1 file for
the TI-Writer.

..NF;NA

100 OPEN #1:"DSK3.DATAMERGE",VARIABLE 163
110 FOR X=1 TO 19 :: PRINT #1:CHR$(0);CHR$(X*5);CHR$(147);
120 FOR Y=1 TO 5 :: CALL CHARPAT(X*5+Y+26,C$):: GOSUB 170 :: D$=""
130 FOR Z=8 TO 1 STEP -1 :: D$=D$&CHR$(D(Z)):: NEXT Z
140 PRINT #1:CHR$(199);CHR$(8);D$;
150 IF Y=5 THEN PRINT #1:CHR$(0)ELSE PRINT #1:CHR$(179);
160 NEXT Y :: NEXT X :: PRINT #1:CHR$(255)&CHR$(255):: CLOSE #1 :: STOP
170 FOR Z=1 TO 8 :: E1$=SEG$(C$,2*Z-1,1):: E2$=SEG$(C$,2*Z,1)
180 F1=ASC(E1$)-48+7*(ASC(E1$)>60)
190 F2=ASC(E2$)-48+7*(ASC(E2$)>60)
200 D(Z)=F1*16+F2 :: NEXT Z :: RETURN

     Next you type in the main program - it's actually quite short!

100 DIM D$(126),A$(60):: FOR X=32 TO 126 :: READ D$(X):: NEXT X
110 ESC$=CHR$(27):: OPEN #2:"PIO.CR" :: PRINT #2:ESC$&"A"&CHR$(7);ESC$;"C";CHR$(
0);CHR$(11);
120 FLAG=0 :: INPUT "TEXT FILE: DSK":F$ :: OPEN #1:"DSK"&F$
130 FOR X=1 TO 60 :: LINPUT #1:A$(X):: IF EOF(1)THEN 150
140 NEXT X :: GOTO 170
150 FLAG=1 :: CLOSE #1 :: IF X=61 THEN 170
160 FOR X=X+1 TO 60 :: A$(X)=RPT$(" ",80):: NEXT X
170 FOR X=1 TO 60 :: A$(X)=A$(X)&RPT$(" ",80-LEN(A$(X))):: NEXT X :: FOR X=1 TO
80 :: PRINT #2:ESC$&"K"&CHR$(224)&CHR$(1)
180 FOR Y=60 TO 1 STEP -1 :: B$=SEG$(A$(Y),X,1)
190 PRINT #2:D$(ASC(B$));
200 NEXT Y :: PRINT #2:CHR$(13)&CHR$(10):: NEXT X :: PRINT #2:CHR$(12):: IF FLAG
=0 THEN 130
210 INPUT "D0 ANOTHER?(Y/N)":AN$ :: IF AN$="Y" THEN 120 ELSE CLOSE #2
..FI;AD



Note that in line 110 I have put in codes for 7/72 inch linefeeds, and a
formfeed of 11 inches.  Check your printer codes to make sure they are the
same.  Now merge in the file created previously by typing MERGE DSK1.DATAMERGE
This will put in 19 lines numbered from 5 to 95 in increments of 5, and if you
list them they will look crazy.  DON'T CHANGE THEM!! Now save the program under
whatever name you wish, and it's ready to run.  The only limitation is that the
file must contain only ASCII codes 32-126, that is no control characters or
deletes (127).  You can ensure this by using the PF function of the TI-Writer
and typing C DSK1.yourfile Have fun.

Note also that if you are sure that the right margin of your file is always
less than 80, you can substitute whatever it is for 80 in lines 160 and 170
(twice).  You can also use this program to print an entire Multiplan listing
lengthwise by using the print on disk option and always giving a margin of 80
or less.

ALL YOU HAVE TO DO IS TYPE IN THE PROGRAM
AND RUN IT.
DENNIS ai250