There are many situations where you want the last name listed first for alphabetizing purposes, but would prefer any printout to be in normal order. The next routine will allow you to print out any name on the first line in either order you prefer. The screen will not change and your files will be unaltered. Only the printout is affected.
Some guidelines to remember are that the routine will take anything up to the first space to be the last name and anything from there to the second space to be the last name. Any data after the second space will not be printed when the routine is activated. This can be used to your advantage. Also, since the routine looks for spaces, do not use commas to separate the names or it will appear after the last name on the printout. Some examples follow. The first column shows what is on the first line on the screen and the second shows the resulting printout when activated:
SMITH JOHN JOHN SMITH
DOE, JOHN JOHN DOE,
REAGAN RONALD (PRESIDENT) RONALD REAGAN
JONES Jr BILL Jr JONES
To activate the routine, just hold down the ENTER Key when entering “C” for copy or starting an auto search with printout routine until the printer starts copying, then you can release the key. If you don’t want the routine activated you better release the key quickly. On an auto search the routine will copy all files the same way once activated. When editing, if you press “THEN” for a printout, the name reverse is not activated.
7205 IF CODE INKEY$=J-H THEN LET Y=H
7206 IF Y<>H THEN GO TO VAL "7213"
7207 LET L=O: LET C=O: FOR X=H TO Q: IF E$(U,X)=" " THEN LET C=X+U: GO TO VAL "7209"
7208 NEXT X: IF C=O THEN GO TO VAL "7212"
7209 FOR X=C TO Q: IF E$(U,X)=" " THEN LET L=X-U: LET X=Q
7210 NEXT X: IF L=O THEN LET E$(U,C TO )=" "+E$(U, TO C-H): GO TO VAL 7212
7211 LET E$(U)=E$(U,C TO L)+" "+E$(U, TO C-H)
7212 IF Y$="C" THEN LET Y=O
7213 FOR X=U TO LEN C$: IF CODE C$(X)=O THEN LPRINT