150 TEXT : HOME : NORMAL : VTAB 10: HTAB WIDE -9: & "Amper-Format Demo": PRINT : HTAB WIDE -8: & "By Howard Huang": PRINT : HTAB WIDE -20: & "* Copyright 1986 by MicroSPARC, Inc. *"
160 GOSUB 820
170 REM
180 REM === SELF-PRAISE ===
190 REM
200 HOME : & "Welcome to Amper Formatter!"
210 & RET$: & " Amper Formatter is a machine language utility designed to format text strings for screen display."
220 & " The features include:": & RET$: & "1) Automatic word wrapping": & "2) Detection of 40 or 80 column screen"
230 & "3) Conversion of lower to upper case": & "4) Page breaks on the screen"
240 & "5) DOS 3.3 - ProDOS compatibility": & RET$: & " This is a short demonstration that highlights these features and shows you how to use Amper Formatter from within your own programs."
250 GOSUB 820
260 REM
270 REM === WORD WRAP ===
280 REM
290 & " First, let's look at word wrapping. Normally, when the Apple reaches the edge of the text screen, it automatically goes down to the next line. This sometimes causes";
300 & " words to be split in the middle, resulting in unreadability and an unprofessional appearance.": & RET$
310 & " With Amper Formatter, you may use messages of any length in your programs without worrying about word breaks; Amper Formatter will break them for you!": & RET$
320 GOSUB 820
330 & " If you list this program, you'll find that all the text is unformatted, and that the lines are being properly formatted and printed by Amper Formatter, with carriage returns in the proper places."
340 & RET$: & " Just type your messages once and they are automatically formatted for the size of the screen.": GOSUB 820
350 REM
360 REM === 40/80 COLUMNS ===
370 REM
380 & " Another nice feature is the ability to detect whether or not the 80-column card is active. If the card is active, Amper Formatter will take advantage of it and break the words accordingly.": & RET$
390 & " You might want to try running this program in ";: IF PEEK(49183) >128 THEN & "40";
400 IF PEEK(49183) <128 THEN & "80";
410 & " column mode to see the difference.": GOSUB 820
420 REM
430 REM === LOWERCASE ===
440 REM
450 & " If you have an Apple II or II+, any lowercase text displayed by Amper Formatter will be converted automatically to uppercase. This way, Apple //e and //c owners can write programs that are compatible with all Apple II's while ";
460 & "still taking advantage of the //e and //c's new features.": & RET$
470 & " To see the difference, try using this program on an Apple ";: IF PEEK( -1101) = 6 THEN & "II or II+";
480 IF PEEK( -1101) < >6 THEN & "//e or //c";
490 & ".": GOSUB 820
500 REM
510 REM === PAGE BREAKS ===
520 REM
530 & " Amper Formatter will also handle text displays longer than one screen long. Amper Formatter will count the number of lines printed, and when 23 lines have been printed, ";
540 & "the word (CONTINUED) is printed at the bottom of the screen, and the program waits until the user presses a key.": & RET$: & "Here's an example:": GOSUB 820
550 FOR I = 1 TO 25:A$ = STR$(I) +" Nibble Magazine": & A$: NEXT I
560 & RET$: & " When you are finished printing text, you should set the line counter back to 0 with POKE 38394,0.": & RET$: GOSUB 820
570 REM
580 REM === DOS - ProDOS ===
590 REM
600 & " Amper Formatter is compatible with both DOS 3.3 and ProDOS.": & RET$
610 & " All of these features, plus machine language speed, make Amper Formatter fast and easy to use.": & RET$
620 & " Now, let's briefly look at how to use Amper Formatter.": GOSUB 820
630 REM
640 REM === USING ===
650 REM
660 & " It's easy to set up Amper Formatter. BRUN the program and set HIMEM: 38144 (37120 for ProDOS).": & RET$
670 & " To actually use the formatter is just as simple. Wherever you want to print something, just use an ampersand [&] instead of PRINT. Here are some examples:": & RET$
680 A$ = "& " + CHR$(34) +"Hello, how are you today?" + CHR$(34): & A$
710 & " The only restriction is with printing blank lines. In BASIC, this is done with a simple PRINT statement, with no string specified. With Amper Formatter, you must supply a string of some kind, even if it's just one space. "
720 GOSUB 820
730 REM
740 REM === WRAP IT UP ===
750 REM
760 & " Amper Formatter will be a super addition to your utility library. Use it well!": & RET$