Unless a last-name-first printout is done when this excellent data base program is used for mail files, a sort by last names requires they be entered on a separate line from the title and first name. The following addition to the Basic listing does a character by character scan of line one, which may be up to 30 characters long, then prints the last name from line two next to the first. The sort is done by line two. There may be no more than one space between title and first name(s) in line one entries. The PAUSE and LPRINT in line 7206 assumes the P/F printer driver is in use and not one on EPROM such as used with the JLO I/F. This line may be adjusted to your own needs for continuous printout, roll labels, or envelopes in a web carrier.
7205 IF Z$<>"0" THEN FOR X=1 TO LEN C$: PRINT E$(X): NEXT X
7206 IF PEEK 26703 THEN LPRINT : PRINT #0;AT 0,0;"Key 0 TO SKIP/ANY CHR$ TO LPRINT ": PAUSE 0: IF INKEY$="0" THEN GO TO 7226
7207 FOR X=1 TO LEN C$
7208 IF X=1 THEN FOR R=X TO 31: IF E$(X,R TO R+X)=" " THEN LPRINT " ";: NEXT X
7209 IF X=1 THEN LPRINT E$(X,R);: NEXT R
7210 IF CODE C$(X)=0 THEN LPRINT
7220 IF X<>1 AND CODE C$(X) AND E$(X)>W$ THEN LPRINT E$(CODE C$(X))
7225 NEXT X
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.