home *** CD-ROM | disk | FTP | other *** search
- TLIB.DOC
- by Rick Charnes, San Francisco, November 18, 1986
-
- This is my second, and favorite, ALIAS I've written
- that can be used to type out member files within a library -
- straight ASCII, squeezed, or crunched. (The other was TLF.COM)
- They both came into being when I realized that with the growing
- popularity of Steven Greenberg's CRUNCH file compression
- algorighm NULU could no longer be relied upon to deal with
- libraries, missing as it is a capability to deal with files of
- this sort.
-
- Syntax is simple. Make sure TLIB.COM, TLIB2.COM, and
- EXIT.COM are all on your disk, and type:
-
- TLIB [DU:] <libraryname>
-
- VERY IMPORTANT:
- (NOTE NECESSARY SPACE BETWEEN OPTIONAL DU: AND <LIBRARYNAME>
-
- (note also: until Master Greenberg comes up with a full Z-System
- version of TYPELZ that supports named directories, [DU:] here can
- only be drive/user and not an NDR.)
-
- When an exit is desired, type 'BYE' at the "FILE TO TYPE"
- prompt.
-
- --> Some changing of terminal escape sequences in TLIB.COM,
- TLIB2.COM, and EXIT.COM may be necessary. My apologies for
- releasing something with non-standardized elements. In TLIB.COM
- I use ESC ) for half intensity, ESC ( for normaly intensity. In
- TLIB2.COM I use <ESC>G8 for underlining and <ESC>G0 turns it off,
- and in EXIT.COM <ESC>G4 turns on reverse video and this also
- turns off with <ES>G0. You should set your own or change it to
- whatever you like -- blink, reverse video, dim, etc. These
- changes are best done with BALIAS. <ESC> is created by hitting
- CTL-P, then the ESC key. See (way) below for more info.
-
- A program of this nature is most important when dealing
- with *.LBR's containing a large number of crunched files in that
- TLIB returns you a directory of the library after you've
- finished reading each file. Hence you're not continually having
- to do a DIR or otherwise listing the contents within the library
- when moving from reading one file to another. I very much enjoy
- some of the new library "shell" programs coming out for their
- advanced features and ease of use. But, e.g., I recently
- downloaded a library of 12 (!) text files, all crunched. I
- DEFINITELY want to have displayed for me in this situation a
- directory of all the files immediately and automatically after
- reading each member.
-
- For a long time I was using NULU in its regular "NULU
- mode", and I would be faced with the same problem --- having to
- constantly do a "-L" to list out the files in the library so that
- I could choose which I wanted to read or otherwise act upon.
- Then I discovered its "F"=Filesweep mode which operates like
- NSWP. Here you essentially have a listing/directory of the files
- in front of you, and you choose your command to act on each as
- you prefer. This of course is ideal. But until that happy day,
- programs like TLIB are, for me at least, crucial. How do other
- people deal with libraries of many members, all crunched, without
- extracting them?
-
-
- ***************************************************************
- * *
- * What follows is more of an excursion into my own learning *
- * process in writing this, complete with appropriate *
- * philosophical commentary where appropriate than a true, *
- * minimalist doc file, so you're welcome to proceed at your *
- * own risk -- uh, speed. - Rick Charnes *
- * *
- ***************************************************************
-
-
-
- One learns best when answering one's own questions...
-
- * * *
-
- "Could someone explain VALIAS' "recursive" mode to me?
- I just don't get it."
-
- Thus went the message I sent to Z-Node Central perhaps two
- weeks ago, and as sadly is too often the case on 8-bit BBS's in
- these days of the dominance of the IBM behemoth, it went
- unanswered. So...encouraged by accidentally stumbling across the
- VALIAS doc file --- I'm not really sure how I ever missed it
- before -- I taught myself about VALIAS recursion, and it has
- greatly fueled my Z-imagination. No doubt had I learned from
- someone else the power of it all wouldn't have hit so well. Many
- thanks to VALIAS author Jay Sage, who has actually returned phone
- messages to San Franciso I have left with his family for his
- generosity, friendliness, warmth, and overall good Samaritanship
- in providing the emotional support and software tools to make
- being a beginning Z3-er like myself an overwhelmingly pleasurable
- and exciting experience.
-
- All this by way of introduction to my release of my alias
- TLIB.COM, an example of the use of VALIAS' recursive mode. TLIB,
- continuing in the tradition started by Echelon's GLF, is a way of
- entering a library and then viewing multiple files inside it,
- especially valuable if they are crunched and not otherwise
- accessible via ordinary tools. Until NULU is updated to include
- the capacity to uncrunch library members, we need to rely on
- aliases like this or Terry Carroll's ZLBR10A.COM. I have too
- often entered a library with NULU only to find the DOC file
- and/or source file is crunched, thus precluding the use of NULU.
-
- TLIB is similar to my previous TLF.COM, except that the
- libary directory automatically and by default displays after you
- have finished reading a library member. Since TLF, I have still
- been slightly annoyed with the way you had to hit <CR> to get the
- library directory displayed back on your screen after viewing a
- file within a library. TLF returns you to the CMD.COM prompt at
- which point you can exit the ALIAS with SHCTRL P, or anything
- else to see the directory again. But I always wanted to the
- directory to come up IMMEDIATELY after the viewing of a library
- member without my having to do anything; I wanted it to be the
- default.
-
- I'm sure there are umpteen ways to do this, but I always
- try to take the path by which I will learn the most, and VALIAS'
- recursive mode seemed to be a very good teacher. Briefly, this
- mode permits you in a sense a "GOTO START" label within an alias.
- It permits you to loop indefinitely back to the beginning without
- overloading the multiple command buffer. Or it can be used
- in the same vein as I have here to loop back and forth between
- several different ALIASes, again without the looping causing the
- dread command buffer overflow. It "cleans out" all superfluous
- commands. So I figured it would be a perfect way to immediately
- come back to display the library directory after typing a file.
-
- But then there always arises the question of how to exit
- the loop when you wish to. Unfortunately, one cannot exit from
- TLIB with a CTL-C like you can from a ZEX script. So, studying
- and re-studying my RESOLVE documentation, I put my bet on a long
- shot: what were the chances RESOLVE could properly deal with a
- flow command? I wasn't sure, but I tried it:
-
-
- TLIB2.COM (the body of the program)
- ----------
-
- ECHO ])G8 * DIRECTORY OF $1.LBR * G0
-
- LLF $2$1 ;Displays the library directory.
- GETVAR TLIB FILE TO TYPE? ;Gets the variable, names it %TLF.
- RESOLVE IF %TLIB=BYE ;WOULD THIS WORK? If the user
- ;enters 'BYE', then go to ....
- EXIT ;ANOTHER Alias, called EXIT, which
- ;exits the user back to ZCPR3.
- ELSE
- RESOLVE TYPELZ $2$1 %TLIB ;..or else type the library file.
- TLIB2 $1 $2 ;Here's the recursion. Return to
- ;initial ALIAS TLIB.COM, display
- ;a directory, and pass the
- ;parameters, please
- FI
-
-
- It worked! RESOLVE.COM properly resolves the IF/%TLF
- combination. If the user replies 'BYE' at the "FILE TO TYPE?"
- prompt, s/he is then sent to the alias EXIT.COM which exits the
- entire alias network and returns the user to the friendly skies
- of ZCPR3.
-
- I made TLIB a 3-alias network for an important and
- necessary reason. The initial TLIB alias does nothing but set
- the quiet flag then send the user to TLIB2, the body of the
- thing. Deferring to the noble and time-honored ZCPR3 alias
- tradition, I have also added the classical help file/syntax
- format (IF NULL $1 and IF $1=//) with some pretty dim/normal
- intensity graphics included therein. Terribly sorry if your
- terminal doesn't take "ESC-)" for dim intensity; this program,
- like so many others, started out as something to play around
- with for myself that looked nice. I know releasing something
- non-standard like this is not kosher. I've always thought,
- however, the art of public domain programming is to do as many
- non-kosher things as you possibly can and need to in order to
- have fun and learn as much as possible. I know I passed that
- test with this. Please change it to your terminal's sequences.
-
- TLIB.COM:
- --------
- QUIET S
- TLIB2 $1 $2
-
- The reason I made a separate ALIAS for this - besides needing
- room in the MCL buffer for the syntax scripts - is that if I set
- the command line 'QUIET S' in the same alias as the rest of the
- commands the alias would forever be coming across this line and
- setting the quiet flag on each pass. This is of course totally
- unnecessary and a waste of time, so I'm letting it do it once and
- then forget about it. And of course EXIT.COM, the third in the
- trio, resets quiet. This use of an "multi-alias network" is the
- best substitute I can figure out for the 'GOTO <label>'
- capability I _wish_ ALIASes had.
-
- By the way, it's instructive to try these files out setting
- them in normal, rather than recursive, mode just to see what
- happens. At some point, usually after about the third file
- you've asked TLIB to type, you're *BEEP*ed, sent into EXIT.COM,
- and exited out of the program. What's going on is that, just as
- Jay Sage says will happen, the MCL (what? you don't yet know that
- ZCPR lingo for 'multiple command line'?) buffer fills up past
- that magic 204 character capacity, the flow control network gets
- all confused, the ZCPR3 God throws up his hands, and says, "Out,
- infidel!"
-
- Comments on why I _start_ TLIB2.COM with "FI" rather than
- ending it that way, as is the usual:
-
- I had initally made "FI" the second to last command in the
- alias, just before the recursive "TLIB2 $1 $2" command which
- should be the last command in the alias. This "FI" should be
- there of course to flush the IF level to 0, before the alias runs
- again. But for some reason that PERHAPS God knows, when I did
- that, and then I'd enter 'BYE' I would be given the "RETURNING TO
- ZCPR3..." message ---- AND THE ALIAS WOULD START AGAIN!! Don't
- ask me what's going on. So I figured maybe it's because the IF
- LEVEL is not getting flushed (set back to 0). So I went into
- EXIT.COM and put in an 'XIF' command --- to no avail. The alias
- would still repeat when I tried to exit.
-
- So then I put "FI" as the very last command and that worked
- fine. Until I realized that upon exit from the whole alias
- network the IF level was set to a number corresponding to how
- many files had been viewed. And of course --- the 'FI' was never
- being reached to reset the level back to 0.
-
- So I put it at the beginning, it gets reset each time
- before it even starts, and everyone's happy.
-
- IF levels are a trip. I hope people have fun using
- IFSTAT.COM. I like to abort ZEX scripts and the like in the
- middle and otherwise deliberately set the IF level to
- some ridiculously high level just to watch what goes on. There's
- something philosophically amusing about thinking of something
- existing in a state of (trombones here...) "IF LEVEL 6." One can
- pity a ZCPR3 system having to go through an experience like that.
- I mean can YOU imagine living at an IF level of 6? The _awful_
- sense of insecurity..."Um, if this,,,,and if that....and if the
- other thing, and if, if, if, and if ...."
-
- Speaking of slowing things down, the only reason I have to
- use a separate alias for the EXIT is because as of the present
- state of ZCPR3 flow control, the syntax "~=" (does not equals) is
- not implemented. If that were possible, I could have done:
-
- RESOLVE IF %TLIB~=BYE
- RESOLVE TYPELZ $1 %TLIB
- TLIB2 $1 $2
- FI
-
- and then if %TLIB _did_ equal 'BYE' it would just ignore the IF
- loop and you'd be happily booted out right away. The alias would
- be shorter and run much quicker.
-
- I think my method of allowing DU: designation on the
- command line is kind of ingenious. Aw, come on, give me a break:
- when you're a beginner in this stuff and something works it
- always feels ingenious. I make you use two parameters, though.
- You just have to make sure you put a space between the DU: and
- the library name, so the alias understands them as two
- parameters. If you don't enter a DU: that's OK too and TLIB
- doesn't mind. It just ignores any reference to $2 in the command
- line and uses $1 as the library name. If you enter both, $1 is
- the DU: and $2 becomes the library name.
-
-
- * * *
-
-
- I'd like also to draw fellow Z enthusasiasts' attention to
- my use of the ECHO command to send terminal attribute escape and
- other sequences to the terminal to create attractive displays.
- This is something I've been doing quite a bit of, and am very
- pleased with this capability of ZCPR3. Now of course each
- terminal's codes will be different. <ESC G 8> sets underlining
- on my Qume 102A, and <ESC G 0> turns it off, but you should set
- it according to yours. Also nice is reverse video with <ESC G 4>
- My command line
-
- ECHO ])G8 * DIRECTORY OF $1.LBR * G0
-
- underlines the text, but it also does something else. My
- terminal uses standard (what? standards in 8-bit machines?) ADM-
- 3A-type cursor coordinate addressing, so I use ECHO again, this
- time to send an escape sequence to position the cursor more
- towards the center of the screen. The sequence
-
- <ESC> ] )
-
- tells my terminal to position the cursor to column 10 on the
- current line. ")" here equals "10" in terminal code. If I
- wanted ZCPR3 to display some text on line 6, column 24, I would
- do
- ECHO <ESC>=%7this is my text
-
- The way you get VALIAS or BALIAS to insert an <ESCAPE> code is by
- pressing CTL-P first, then hit your escape key. It will appear
- on your screen as a dim video "]" when using BALIAS, and as "^]"
- in VALIAS. You can also send line feeds and carriage returns in
- your ECHO text by, again, pressing CTL-P first, then CTL-J and/or
- CTL-M. I often do this if I want to space my text with nice
- clean blank lines. I did this in TLIB.COM for the help/syntax
- message. This will only work, however, in BALIAS and not in
- VALIAS. VALIAS doesn't seem to have a "literal" mode for
- carriage return and line feed with CTL-P. So to change TLIB.COM,
- perhaps to change the intensity attributes, you'll have to use
- BALIAS (I've never used TALIAS). Once you've put ^J's into an
- alias, VALIAS' line numbering gets all screwed up and you
- shouldn't even hope to try to use it.
-
- Also in VALIAS only, when you do your CTL-P's to enter an
- <ESC> code, be prepared to have your printer turned on as a side
- effect. No problem --- just do a second CTL-P to turn it off.
- This second CTL-P won't get entered into your alias.
-
- I do a lot of this cursor positioning and find it an
- excellent way to pretty up otherwise drab program display.
-
- One thing I forgot about VALIAS' recursive mode. I don't
- know about other folks, but I will often switch back and forth
- between VALIAS and BALIAS in the course of a creating, working
- on, and editing an alias. Each does a certain set of things
- best. If, however, you're using VALIAS to create a recursive
- alias, if you then go and edit it with BALIAS, this will "de-
- recursify" it. It apparently takes out or resets the flag or
- byte with which VALIAS had previously set it. If you do this ---
- and I often find I must -- that's ok. Just make sure that the
- very last thing you do before you're ready to run the alias is to
- edit it in VALIAS and set the recursive flag. Any changes that
- BALIAS did to it will be remedied.
-
- Have fun with TLIB and leave me a message if you have any
- comments.
-
- Rick Charnes, San Francisco, California
- President, Bay Area (Morrow) Micro Decision Users Association
-
- Home BBS'es:
- Z-Node Central 415/489-9005
- BAMDUA BBS 415/654-3882
- ent, Bay Area (Morrow) Micro Decision Users Association
-
- Home BBS'es:
- Z-Node Central 415/489-9005
- BAMDUA BBS