• Big U part 3

    From mspangler@mspangler@gemsi.com (Michael Spangler) to comp.sys.apple2 on Saturday, July 19, 2003 18:29:28
    From Newsgroup: comp.sys.apple2

    keycat and the amper programs


    KEYCAT.80
    KEYCAT.80 is a "file menu" program that lets you select programs from
    disk with only a couple of keystrokes. After typing "-KEYCAT.80" only
    once, you can access the file menu any time you want by pressing
    Control-Reset or by typing "/RAM/MENU".
    KEYCAT.80 CREATES MENU
    When you type "-KEYCAT.80" (see next page), you are actually creating
    a new file called "MENU" on the RAM disk (if you have 128K) or on a
    floppy disk (if you have only 64K).

    IF YOU DON'T HAVE 128K
    KEYCAT.80 comes set up so that MENU will be stored in the RAM disk
    (slot 3, drive 2--128K required). If you have only 64K, stop now and
    Run the KEYCAT.SETUP program (see page 36). It will let you specify a
    new slot and drive for the disk that will contain the MENU program.

    TO CANCEL CONTROL-RESET
    MENU is normally activated by pressing Control-Reset. If, however, you
    don't want our program messing with Control-Reset's normal
    functioning, stop now and Run KEYCAT.SETUP (page 36). It will let you
    prevent Control-Reset from activating MENU. Typing "-/RAM/MENU" will
    still do the job.

    GETTING STARTED KEYCAT.80 is harder to explain than it is to use, so
    go ahead and use it and see what happens. Here's what you do:
    1. Remember, if you don't have 128K, or if you don't want to use
    Control-Reset, use the KEYCAT.SETUP program first (see page 36).
    2. Type "-KEYCAT.80" to create and install the MENU program (do this
    only once).
    3. Bring MENU to the screen by pressing ControlReset, or by typing
    "-/RAM/MENU" (do this anytime you want to select a file). Note:
    Depending on your system and MENU's slot and drive location, you may
    have to type a command like "-MENU,S6,D1" or "-/RAM/MENU".
    4. With the file menu on the screen, press Return to read a directory
    (see page 34) or select a file by pressing the key corresponding to
    the letter or number next to its name (below).

    SELECTING FILES
    Once the files you want are on the screen, select one of them by
    pressing the key corresponding to the letter or number next to its
    name. Then you have three choices:
    1. Press "R" to Run the file. ("Dir" files cannot be Loaded or Run.)
    2. Press "L" to Load the file. ("Bin" and "Bas" files only).
    3. Press Esc to skip selecting this file.
    If the directory has 36 or more files, press "Z" to view more files.
    Press "0" to get back to the first group of files.

    READING A NEW DIRECTORY
    If there are no file names visible in the menu, or if you want to see
    files from another disk, press Return and select one of the options
    that appear at the bottom of the screen:
    Press "C" to read the current drive. This is the drive where MENU
    found the current directory.
    Press "O" to select any Other slot and drive. After you select a slot
    (1-7) and drive (1-2), the main directory on the disk in that drive
    becomes the Current Directory. (To select a subdirectory from that
    drive, press Return and then "S".)
    Press "M" to select the MENU drive. This is the directory where the
    MENU file is stored; either the RAM disk (slot 3, drive 2), or the
    drive specified by KEYCAT.SETUP.
    Press "S" to read a Subdirectory. This option only works if one or
    more Directory ("Dir") files are listed on the screen.

    ERRORS
    When an error occurs, pressing Esc will give you a chance to "make
    repairs". Most errors are caused by leaving drive doors open, putting
    disks in upside down, or using DOS 3.3 disks. Only ProDOS disks are
    allowed.
    A "Device Not Connected" error when you type "-KEYCAT.80" means you
    don't have a IIc or 128K Ile, or your RAM disk has been disconnected.
    To reconnect, reboot or use FILE.MOVER (page 28).
    A "Path Not Found" error when you type "-MENU" probably means that you
    need to specify a slot and drive (for example, type "-MENU,S3,D2" or "-MENU,S6,D 1 ").
    A "Path Not Found" error could also mean that the floppy disk with the
    MENU program on it has been removed. Put it back in the correct drive
    when you type "-MENU". (128K RAM disk users don't have to worry about
    this.)
    HARD DISK USERS
    If you have a hard disk, use KEYCAT.SETUP to configure for the
    appropriate slot and drive, then make this your STARTUP program after
    running KEYCAT.80 to create MENU:
    10 PRINT CHR$(4)"-MENU"
    KEYCAT.80 and GPLE GPLE, Beagle Bros' Applesoft editor, uses
    Control-Reset to reconnect itself. If you want to use KEYCAT.80 with
    GPLE, it's best to de-activate the Control-Reset option with
    KEYCAT.SETUP.
    Then you can add a GPLE "-MENU,S3,D2" Escape command to activate. Now
    a command like Esc-M will activate MENU and Control-Reset will still
    be available for reconnecting GPLE.

    RESETTING RESET
    To cancel KEYCAT.80's grip on ControlReset, you can reboot, or type:
    "POKE 1010,0: POKE 1011,190: POKE 1012,27"

    MENU SIZE LIMITATIONS
    The MENU program is a type "BIN" file that is 8 or more blocks in
    size, depending on the number of file names it contains. Its limit is
    255 files.
    You can look at MENU (after you have created it) by cataloging the RAM
    disk (type "CAT/RAM") or the appropriate floppy drive.

    KEYCAT.SETUP
    KEYCAT.SETUP lets you configure KEYCAT.80 to work with your specific
    system and preferences. Type "-KEYCAT.SETUP" to get started. You will
    be asked:
    1. Whether or not you want Control-Reset to activate the MENU program.
    2. The slot and drive where the MENU program will be stored.
    Follow the instructions on the screen and select your preferences. A
    little experimenting doesn't hurt, because you can always reconfigure
    the program later. When you are finished with KEYCAT.SETUP, it will
    re-Save KEYCAT.80 on disk.
    CONTROL-RESET OR -MENU? Normally, you press Control-Reset to activate
    MENU. This method is quick and easy, but has some drawbacks. It takes
    some room on memory page 3, and other programs may need to use that
    area. No Big U programs have any conflict with KEYCAT.80 or MENU.
    If you don't want to use Control-Reset, disconnect it. Now only the
    command "-/RAM/MENU" will activate MENU. This method is a little more cumbersome, but doesn't use any memory until MENU is actually
    activated. (MENU runs on hi-res page 2: $4100.6000).

    SELECTING THE MENU DRIVE
    On 128K Apples, the RAM disk (slot 3, drive 2) is the preferable
    location for MENU. Otherwise you may put it anywhere you like. The
    most obvious choices would be slot 6, drive 1 or 2.

    Big U's AMPER Programs
    Each Big U "AMPER" program gives you one or more new commands that
    begin with the the magic ampersand ("&") character (&STORE, &INPUT,
    etc.). You load or "install" each program in memory by typing a hyphen
    ("-") followed by the program's name. Once a program is installed, its
    new "amper-commands" are yours for the typing.

    WARNING: LOAD ONLY ONCE!
    Each AMPER program costs you a little more memory, so don't waste
    saace by loading the same program more than once. You might want to
    write an installation program that runs only once. It loads the
    ampersand commands that you want, and then Runs the program that uses
    the commands. For example:

    10 TEXT: HOME: NORMAL: REM RUN THIS PROGRAM ONLY ONCE!
    20 PRINT CHR$(4);"-DUMP.80": REM LOADS BIG-U'S PROGRAM
    30 PRINT CHR$(4);"-INPUT.80": REM LOADS ANOTHER BIG-U PROGRAM
    40 PRINT CHR$(4);"-SCREEN.PRINTER": REM RUNS YOUR PROGRAM

    "&" TECHNICAL NOTES: Each ampersand program installs itself above
    Himem so your programs don't overwrite it.
    When Applesoft encounters an "&", it jumps to location $3F5 (1013
    decimal) and follows the machine-language instruction there--usually a
    jump (JMP) to another address.
    When the ampersand programs are installed, they save the existing
    jump-address at $3F5-3F7 before plugging in their own. This technique,
    known as "daisy-chaining", lets many ampersand programs reside in
    memory together.

    APPENDER
    Install only once: Type "-APPENDER". Function: Joins two or more
    Applesoft programs. New commands:
    &STORE "hides" the program in memory so you can load in a second
    program.
    &RECALL appends the hidden program onto the end of the second program.
    Example:
    Let's call our higher-numbered program "HI.PROGRAM" and the other one "LO.PROGRAM". Be sure that the programs don't have overlapping line
    numbers. Renumber them if they do. There are several renumber programs
    on the market, including the one on our Double-Take disk.
    1. Type "-APPENDER" (only if you haven't already). 2. Type "LOAD
    LO.PROGRAM" (unless already loaded). 3. Type "&STORE" to hide
    LO.PROGRAM. (A "Lowest Useable Line Number" message will appear.) 4.
    Type "LOAD HI.PROGRAM". 5. Type "&RECALL" to connect the two programs.
    6. Type "LIST" to see the appended programs. This newly-created
    program can be run normally if the line numbers are in order.

    ANOTHER USE FOR APPENDER
    &STORE can also be used to temporarily hide an Applesoft program while
    you run another program. Type "NEW" to get rid of the test program,
    then "&RECALL" to get your original back.

    DUMP.40 and DUMP.80
    Install only once: Type "-DUMP.40" for 40 columns or "-DUMP.80" for 80
    columns. New command: &POP (stands for "Print On Paper")
    Function: Prints the text screen on your printer.
    Comments: &POP is fast because it doesn't waste time printing blank
    spaces at the end of a line.
    If you have an Apple IIc or Apple Ile with an 80-column card, you can
    use the new DUMP command instead (see page 48).

    PROGRAM EXAMPLE:
    10 REM DUMP.40 MUST BE IN MEMORY
    15 PRINT CHR$(21): REM 40-COL SWITCH
    20 FOR Y=1 TO 24: FOR X=1 TO 40: IF
    X<40 OR Y<24 THEN VTAB Y: HTAB X:
    PRINT CHR$(X+32+Y);: NEXT: NEXT
    30 VTAB 1: REM ANY PROGRAM
    40 &POP: REM DUMP SCREEN
    50 REM CONTINUE WITH PROGRAM
    80-COLUMN PRINTER PROBLEMS?
    DUMP.80 and the DUMP command (page 48) send a carriage return to the
    printer after every 80 characters. If your printer does this
    automatically and you are getting some kind of double-spacing, here's
    the solution:

    1. Type "BLOAD DUMP.80" (or BLOAD DUMP).
    2. Type "POKE 16385,0".
    3. Type "BSAVE DUMP.80" (or BSAVE DUMP).

    Note: DUMP.80 Requires 80 columns!

    INPUT-40 and INPUT.80
    Install only once: Type "-INPUT.40" for 40 column input or "INPUT.80"
    for 80 columns. New command: &INPUT
    Features:
    -All visible characters are acceptable as input, including commas and
    colons.
    -Control-characters are ignored.
    -Maximum string length is programmer-definable. The standard length is
    20 (if someone hasn't changed it already).
    -Pressing Esc returns a null string (as in A$="") regardless of cursor position.
    -Pressing Return accepts the input as it appears, regardless of cursor position.
    -Pressing Control-Y clears from the cursor to the end of the line.
    -Pressing Delete deletes the character to the left of the cursor and
    closes the gap created. The left and right arrow keys are used
    normally. (If you don't have a Delete key, see next page.)
    Limitations:
    -String variables only (For numeric input, use the VAL function as
    shown in the examples).
    -Screen input only (&INPUT cannot be used for getting data from a disk
    file).
    -Insert is not available. Check the NOTES program; maybe we've added
    it by now.

    Example:
    10 REM INPUT.40 MUST BE IN MEMORY
    15 &INPUT "TYPE YOUR NAME HERE (LAST, FIRST): ";A$
    20 PRINT "HELLO, ";A$;"!"

    This example works whether or not the user typed a comma between his
    last and first names. Normal INPUT would have cut the name short at a
    comma.

    INPUT.SETUP
    This program lets you change two key features of the INPUT.40 and
    INPUT.80 programs:
    1. The maximum string length allowed. For example, you might want to
    limit someone to typing only a 5-character word.
    2. The key to be used as the Delete key. For example, if your Apple
    doesn't have a Delete key, you might want to use control-D instead.
    Type "-INPUT.SETUP" and follow the instructions on the screen. When
    you are finished, a new version of INPUT.40 or INPUT.80 will be saved
    on disk.

    POKING THE MAXIMUM STRING LENGTH
    Another way is to change the maximum string length is to do it with a
    Poke. For example, to change the maximum allowable &INPUT string
    length to 5:

    1. Install -INPUT.80 or -INPUT.40.
    2. Immediately let LOC=PEEK(1015)*256+7
    3. Let MAX=5 (for a maximum length of 5)
    4. POKE LOC, MAX
    PROGRAM EXAMPLE:
    10 REM INPUT.80 MUST BE IN MEMORY
    20 REM AND LOC MUST HAVE BEEN SET
    30 POKE LOC,10: REM LENGTH=10
    40 &INPUT "TYPE A WORD: ";X$
    60 POKE LOC,2: REM NEW MAX LENGTH
    70 &INPUT "ENTER 2-DIGIT NO: ";TD$
    80 TD = VAL(TD$): REM CONVERT STRING
    TO NUMERIC VARIABLE
    90 PRINT X$, TD * 2: GOTO 30

    REMOVE and REM.OVE.128
    Install only once: Type "-REM.OVE".
    If you have 128K, type "REM.OVE.128"
    New command: &REM
    Function: Removes all REMarks from the Applesoft program in memory.
    Rem's are helpful when programming, but when a program is executing,
    they take up room and slow things down.

    REM.OVE
    This program simply deletes all Rem's from the program in memory.
    Before you make any changes to your program, you will probably want to
    load your Rem'd version back in from disk. To use it:
    1. Type "-REM.OVE"
    2. Load an Applesoft program with Rem's.
    3. Type "&REM" to remove the Rem's.
    4. Run the program without Rem's.
    5. Re-load the Rem'd version from disk.
    6. Make changes to it.
    7. Save the program back to disk.
    8. To test it again, go back to step 3.

    REM.OVE.128
    This program also deletes Rem's, but it first saves a copy of the
    Rem'd version of your program, named "SOURCE" on the ProDOS RAM disk:
    Slot 3, Drive 2.
    From there, you can more-quickly retrieve your Rem'd version. To use
    it:
    1. Type "-REM.OVE.128"
    2. Load an Applesoft program with Rem's.
    3. Type "&REM" to save the program on the RAM disk and remove the
    Rem's from main memory.
    4. Run the program without Rem's.
    5. Type "LOAD/RAM/SOURCE".
    6. Make changes to the program.
    7. To test it again, go back to step 3.
    8. Save the program on disk.
    Warning: Never use REMOVE from within a program; weird things might
    happen!
    As Rem's are removed, you will see an "*" for each full program line eliminated, and a "." for each Rem dropped from the end of a line.
    When done, the total bytes saved will be printed on the screen.

    GOTO WHERE?
    If you're in the habit of issuing GOTO's or GOSUB's to a Rem-only
    line, as in the sample below, insert a colon before the Rem before
    using REMOVE.
    1000 GOTO 2000
    2000 :REM NOTICE THE COLON.
    2010 PRINT "HELLO"
    After Rem's are removed, the line will be left with only a colon (":") following the line number:
    1000 GOTO 2000
    2000 :
    2010 PRINT "HELLO"
    Without the colon, the entire line would have been removed and you
    would get an ?Undef'd Statement Error when you ran the program.
    Actually, it would be more efficient of you to just GOTO the next line
    (you would save 6 whole bytes).

    AND NOW A WORD FROM OUR SPONSOR
    "For the maximum in program compacting, including erased Rem's,
    shortened variable names and automatic combining of program lines, use
    Beagle's D CODE disk. See our catalog for details."

    SUPER.POKE
    Install only once: Type "-SUPER.POKE".
    New command: &POKE
    Function: Allows an easier way to poke a range of memory or a string
    of numbers from Applesoft. A demo program resides semi-hidden on the
    Big U disk.
    Type "-COPYRIGHT. 1985" to see it.

    FILL A RANGE OF MEMORY
    Syntax: &POKE start: end, value
    "start", "end" and "value" can be literal numbers or variables.
    10 REM EXAMPLE #1: FILL A LINE
    15 FOR X=0 TO 255
    20 &POKE 1024:1063,X: NEXT
    10 HGR: REM EXAMPLE #2: FILL HI-RES
    20 VTAB22: INPUT "NUMBER (0-255):";X
    30 &POKE 8192:16384,X: GOTO 20
    POKE A STRING OF NUMBERS
    Syntax: &POKE start, value1, value2, etc.
    "value 1" and "value2" can be literal numbers or variables. This
    routine is useful for replacing lengthy For-Next loops which read Data statements and Poke in values.
    Example: &POKE 1024,193,194,195 prints "ABC" in on
    the screen. 1024 is the upper left of the screen. 193, 194 and 195 is
    ASCII for "ABC".
    And, adapted from Tip Book #7:
    10 HGR2: HCOLOR=3: &POKE768,0,0,96,
    173,48,192,136,208,4,198,1,240,8,
    202,208,246,166,0,76,3,3,96
    20 HPLOT 0,0: FOR P=1 TO 254 STEP 3:
    &POKE O,P,4: CALL 771: HPLOT TO
    INT (RND(1)*P),.7*P: NEXT
    --- Synchronet 3.18b-Win32 NewsLink 1.113