Ty1.3 Documentation  Program: Ty1.3 (5th Sept 89) Purpose: To display text files (like "more","less","most","muchmore", et al). Primarily for use from the Workbench environment, on "bootable" Newsdisks (ie: no special libraries, etc). Author: John Bickers (most recent), 214 Rata St, Naenae. And: This program is based on "less v48", by Mark Nudelman, and copyright 1984,85. This was ported to the Amiga as ty1.0, at the end of 86, by Tony Wills, for use on the Newsdisks. Tony Wills took it from 1.0 to 1.2. Now I have moved it along (a bit) to 1.3. Numerous suggestions and bug-spottings came from Tony Wills, with some elements also based on CA's "more v3.23". There is an Amiga LESS 1.3, also derived from Mark Nudelman's "less" program (but a later version than v48). It has no other connection to ty1.3, and vice versa. Usage: A '?' option gives: 1st NZAmigaUG (Wgtn) Ty v1.3 - Sep 2 1989 :text display program. USAGE: ty [<{+|-}{mode}>] [#{num}] where filename = the name of a file to read. mode = f [+] fast line mode (ignore's special chars). t [+] twiddle mode (marks lines after EOF with ~). b [+] back scroll. T [-] top scroll. q [-] quit after two attempts to go past EOF. s [-] squeeze multiple blank lines together. S [-] scroll bar. p{s|m|l} [s] prompt type (short|medium|long). m [-] maximise window size. P{str} [ ] set default search pattern to str (max 20). Q [-] be quiet (use DisplayBeep for bell). '+' means turn mode on, '-' means turn mode off, defaults are above. num = number of buffers to use [min/default = 5]. NOTE: [] - optional, <> - 1 or more, {} - mandatory. A number of options can be set via the ToolTypes part of either ty's or a project's icon. These are: FAST - fast line mode (eg: "FAST=ON" or "FAST=OFF"). TWIDDLE - twiddle mode (as above). BACKSCROLL - back scroll mode (as above). TOPSCROLL - top scroll mode (as above). QUITEOF - quit at EOF (as above). SQUEEZE - squeeze mode (as above). SCROLLBAR - activate vertical scoll bar (as above). PROMPT - may be short, medium or long (eg: "PROMPT=LONG"). NUMBUFS - set number of buffers to use (eg: NUMBUFS=20). MAXIM - resize window to maximum size (eg: "MAXIM=ON"). PATTERN - set search pattern (eg: "PATTERN=NZAmigaUG") QUIET - use DisplayBeep() instead of audio bell. A number of options can also be set in the ENV:ty variable. These correspond to the CLI options (without filenames). For example: 1> setenv ty "+m +S +PNZAmigaUG #20 +q +pl -f" would set maxim to true, activate the vertical scroll bar, set the initial search pattern to "NZAmigaUG", set the number of buffers to 20, turn on quit-at-EOF mode, set prompt type to long, and turn off fast line mode. The order in which options are searched for is:  CLI WB ENV:ty ENV:ty CLI args ty.info project.info Once the program has started, all keyboard commands can be obtained by pressing the {HELP} key. Notes: Messages: Most prompts, error messages, etc appear in the title bar, so look around before you decide a command hasn't done anything. Gadgets: The main reason for moving from 1.2 to 1.3 was to add gadgets to the user interface. This has been done, in abundance. Almost all gadgets have a keyboard equivalent. Those that do not are the scroll bars, and the boom gadget, since I had a problem with the timing of Intuition's NEWSIZE message. All gadget operations are either abortable or harmless. So feel free to experiment with them. Both the imagery and the functionality are in a state of flux, so it is impossible to describe the gadgets in detail here. The gadgets in the right border have a right-mouse-button operation. Thus if you release the MENU button over these gadgets something should happen. They are generally related somehow to the normal operation of that gadget. Searching: You can specify a pattern with the following wild cards: ? : match any one character * : match one or more characters This has been grafted onto an implementation of the KMP string matching algorithm, and has a bug with '?'. The details are too involved to go into here, but a?b will not find a match in aadb, for example. My fault entirely (too lazy to fix). You can abort searches by pressing ESC. Resident: This program uses Lattice C's excellent cres.o startup module to make itself "pure". So it can be made resident, and multiple copies can be run simultaneously. This works OK under WShell. Should also work under the CA shell. Iconification: Leo Schwab's Iconify() function from Fish126 is used for this. Just a simple image for now, though his code is capable of more. Paging: Ty recognizes ^L characters at the beginning of lines as page breaks. If you turn OFF back scroll mode, then the paging is basically the same as in "more v3.23". This makes moving backwards a line at a time a visual horror, but "more" doesn't allow that anyway. You also have to turn off fast line mode, to convert ^L instead of just pass it through to the console.device. If you do not turn off fast line mode, then the ^L will clear the screen, so you will not be able to see the page of text before a ^L character unless you have phenomenally quick visual recording. If you do not turn off back scroll mode, then paging backwards displays the page twice. First by scrolling the text down, then by repainting the screen when it discovers the preceding ^L. Messy. To turn these modes off in the CLI or ENV:ty use: "-f -b" and from the WB use: FAST=OFF BACKSCROLL=OFF CLI stuff: I have encountered several problems with the code to invoke ENV:EDITOR, and to start a new CLI. 1) I open a CON: with the /c flag so conman will add a close gadget. This requires WShell and PatchDOS to be useful. It has been reported that AShell (ARP) hangs if the close gadget is actually used. I use WShell, and wouldn't change for anything, so I haven't tested this. With ARP1.3 installed, and PatchDOS NOT run, it does not hang on my machine. 2) The following no longer happens since I used NULL as the input pointer for Execute(). But I think it's worth mentioning, as it explains why there is no CLI input for ENV:EDITOR. The CON: used for ENV:EDITOR will go into an infinite loop if PatchDOS and WSHell are present, if the first command you enter after exiting your editor is not endcli. Typing "list", for example, will repeat the list command ad infinitum. Killing it will hang ty, which is waiting for the CON: to terminate. This does not happen if the ARP shell is used, so I presume it's a problem my ^%&#^@ code causes with conman and WShell. Distribution: This program is freely distributable and usable, provided it is not interfered with in an unauthorized fashion. Contact:- NZAmigaUG, c/- Tony Wills, 156c Queens Dr, Lyall Bay, Wellington. (04) 877-258 Complaints/Suggestions/Questions/Aquiring source: Contact:- John Bickers, 214 Rata St, Naenae. (04) 672-085