Screen Macros: The “macro.b6” Program

See all articles from Update July 1990
Author(s): Bill Jones
Publication: Update Magazine
Pub Details: Update July 1990
Date: July 1990
Pages: 27

A “Macro” is defined as a special bit of programming that provides an often needed function. Generally the term “macro” is used with Desk Top Publishing and are associated with specially constructed screens. In this case we use a macro for a special text file. We can create as many macros as we want to and at NO COST of Free Memory. AND, we can print the macros any time we want to by LOADING or MERGING this program.

The program uses managed INPUTs of up to 22 Screen Lines to allow you to input formatted lines. Then when the last line is input there are choices to: PRINT, SAVE, or QUIT. The Screen is SAVED as a special Macro Screen with a file name. Later, at any time, you can re-load the screen (with the “scopy.B6” program for print out. Or, this program will itself allow you to PRINT the macro, either individually, or mixed within a text file that you may be printing.

The Screen holds up to 704 characters, which is a nice size group. Screens are SAVED to disk, using only two blocks of disk space. When they are recalled for print out there is no cost at all of Free Memory.

The screen can be considered as a “data base” contained in a “high resolution String”. The screen is printed out in two ways, by High Res isolation of “pixel” data, and in this case, by low resolution isolation of screen Characters. The data is organized “as in a character array” like <DIM A$(22,31) >. But the screen coordinates begin at zero. So to print a screen character in the top left corner: < PRINT SCREEN$ (0,0) >. We can pick off and LINE PRINT to paper all characters in a screen with counters, as: < For N=0 TO 21: FOR Y=0 TO 31: LPRINT SCREEN$ (n,y);: NEXT Y: LPRINT: NEXT N >.

Given below the listing is a sample print out of one of the Screen Macros used with the Daisy.B6 software.

Line #2444 contains a suggested way for page control while the macro is being printed. Var “nn” counts the lines and IF nn>=LN a page end routine is called by <GO SUB pe>. “LN” in this case is the pre-set number of lines per page. A typical Page End routine would be: >Line pe< LPRINT”’TAB 40;pg: OUT 127,12: LET nn=0: LET pg=pg+1: RETURN >. Enjoy! Bill Jones.

“macro.B6” Create / PRINT / SAVE Screen Macros

Donated to Public Domain by Bill Jones

2442 CLS : INPUT "[1] Create Macro [2] PRINT MACRO[3] SAVE [4] Quit";z: GO TO (z<1 OR z>4)*2442+(z=1)*2448+(z=2)*2444+(z=3)*2460+(z=4)*2462
2444 INPUT "Enter TAB";tb: FOR n=0 TO 21: LPRINT TAB tb;p$(n+1): REM LET nn=nn+1: IF nn>=ln THEN GO SUB pe
2446 NEXT n: GO TO 2442
2448 CLS : PRINT AT 5,2;"Build a Screen Macro"'''TAB 2;"You may input up to 22 Lines."''TAB 2;"The Screen File will be SAVED"'TAB 2;"with the file name that you input, with a "".C4"" extension."''TAB 2;"ENTER WHEN READY": PAUSE 0: CLS
2450 DIM p$(22,31): FOR n=1 TO 22: PRINT AT 21,0; INVERSE 1;"Input Line ";n; INVERSE 0: INPUT p$(n): PRINT AT 21,0;" ";AT n-1,0;p$(n)
2452 IF n=22 THEN GO TO 2458
2454 NEXT n
2458 FOR n=1 TO 22: PRINT AT n-1,0;p$(n): NEXT n: PRINT #0; INVERSE 1;"Touch a Key for Menu": PAUSE 0: GO TO 2442
2460 INPUT "DD # to Save to?";z: RANDOMIZE USR 100: GO TO z: INPUT "Input Name of Macro";w$: LET w$=w$+".C4": RANDOMIZE USR 100: SAVE w$SCREEN$ : CLS : GO TO 2442
2461 DIM p$(1): INPUT "Enter Program Disk #";z: RANDOMIZE USR 100: GO TO z: GO TO VAL "2462"
2462 STOP : REM ** Install your GO TO Line here.
1. This is a SCREEN MACRO
2. Selectable at the Quickie
   and Office Tools Menus.
4. Up to 24 Lines may be input
5. Macros are saved as SCREENS
6. The ".C4" Extension is used
7. A Macro Printer is included
8. (The "scopy.6" program.
10. Printing is to TAB control
11. Macro Printing with scopy
    can be scheduled to print
    the macros mixed with text.
13. Line length limit is 32,
    but the next line can be
    used for wrap around.
16. The macros are not in RAM
    memory, so you may create
    as many as you like in disk
20. A Screen holds up to 704
    characters, which is a nice
    little data chunk.

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.