Utilities Docs  This file includes Documentation for all files in the Utilities Drawer. They have all been combined into one to save disk space. The Docs included in this file are:  Spread MemoPad DWIP KeyClick  Doc File Headers are in RED! *****************************************************************************  SPREAD - Tiny Amiga spreadsheet  Spread history (as if you care): This program grew from a notion I had, 4 years ago, that a spreadsheet would be a good tool to have, to help with certain jobs at the office. I had read about VisiCalc, and later Lotus 1-2-3, but I had never used a spreadsheet, so I designed Spread with few pre-conceived notions about how it should work. As far as I know, Spread bears little resemblance to any other spreadsheet. The first version of Spread was written to run on a PDP-11 running RT11 or TSX, with a VT220 terminal. It was written in Decus C, it only supported fixed-12-character columns, and only what the screen could display. It was later enhanced to support a larger worksheet with scrolling, and to support a 132 column display. Spread is still used at the office almost use daily. When I found myself dialing in to work from my Amiga to use Spread fairly often (a long distance phone call too), I decided it was time to port the program over to the Amiga. The PDP-11 Spread used VT220 display controls and accepted VT220 function keys. These are not completely compatible with the features of the Amiga CON: device, so I decided to re-write the user interface to make best use of the Intuition's input and output features. I started work on the Amiga version in early January 1988, and spent most evenings and weekends at the keyboard (my wife hated it). You have the result before you. Amiga Spread supports a few features the PDP11 version doesn't, specifically the ability of a text cell to overlay empty cells to the right, the ability to set the column width and decimals, it supports a larger worksheet (The PDP version must run in only 56K!), and of course the Intuition interface. Spread features: o Small 36 X 60 worksheet o Four basic math functions, plus row and column summing o Intuition-ized user interface o Resizable Workbench window o Absolute and symbolic cell references in formulas o Worksheet editing: insert/delete row, insert/delete column o Cell editing: cut, copy, paste, erase single cells o Variable column width and decimal places o Automatic or Manual recalculation Running Spread: Spread can be invoked from the CLI or launched from a Workbench icon. If launched from the Workbench, the Lattice C startup code will first open a standard input/output window, which Spread ignores. It is recommended that Spread be given a stack size of 8000. A larger stack size provides no benefit. If Spread is run from the CLI, you can include a command parameter specifying the name of a file which Spread will load as the current spreadsheet. The Spread window gives a display of (r) rows and (n) columns. The number of rows and columns depends on the current size of the display window, the width of the individual columns, and the narrow/wide font selection. The intersection of each line and column is called a cell. Cells may be empty, or they may contain text, or they may contain a formula. Spread currently supports 60 rows and 36 columns. This is very small by commercial product standards. In the window, one cell is displayed in reverse; this indicates the 'cursor'. The cursor may be moved using the arrow keys, or by pointing to a cell with the mouse pointer and clicking. If a movement would place the cursor on a cell which is not in the display window, the display is scrolled. The horizontal and vertical scroll bars also move the display window and the cursor. If a cell contains text, then the text is displayed in the window in that cell. If the text is wider than the current column's width, then the text will 'overflow' into empty cells to the right of the selected cell. If the text is so long that it would overflow into a cell that is occupied, then the text is truncated at that point. If a cell contains a formula, then the result of the formula is displayed in the cell in the window. Calculations are double precision floating point. The number display is initially 2 decimal places. The contents of a formula cell is a string in simple algebraic notation. It is evaluated according to the following rules: Multiplication ('*'), division ('/'), and modulo ('%') are performed first, from left to right; then addition ('+') and subtraction ('-') from left to right; then MAX and MIN left to right; then conditionals from left to right. The order of evauation can be forced by the use of parentheses. If you want a cell to simply contain a number, then make it a formula cell, and type in the number you want as the formula. Formula cells may be given logical names. The names can be referred to in other cells' formulas to call the value from the cell; this allows cell position changes within the display without affecting the logical sources for values in formulas. Only formula cells may be given names. The name must begin with a letter, and may contain letters and numbers. It may not contain spaces. Cell editing (text, formula, or name) is done in the string gadgets at the bottom of the window. When the cursor is on an empty cell, the entry gadgets at the bottom of the window are ghosted and cannot be selected. The "Cells" menu allows the choice of either a text cell or a formula cell. If "Cells/Edit Text cell" or "Cells/Edit Formula Cell" is chosen, then the cell type is chosen, the text gadget is enabled and activated, and the text may be entered immediately. When the cursor is on a text cell, the cell's text is placed in the text gadget. This gadget can be selected and the text modified. When the cursor is on a formula cell, the cell's formula and name are placed in the text and name gadgets. These can be selected and modified. If you wish to change a text cell to a forumla cell or vice versa, you must erase the current cell and define it anew. The menu entries "Edit/Cut" or "Edit/Erase" will erase the contents of a cell. Calculation can be set to automatic or manual. In automatic mode, whenever a formula cell is edited or any change which may effect the numeric results of other cells is performed, recalculation takes place. In manual mode, recalculation is done when the "Calculate/ Evaluate" menu entry is selected, when the user presses the 'C' key, and upon loading a new spreadsheet from disk, and no other time. Calculation is done as follows: Each formula in the spreadsheet is solved, starting in cell R0C0 and moving down, then repeating for successive columns moving right. Cells which depend on other cells' values should be placed under or to the right of the cells which supply the values. If a cell must make a 'forward' reference, to a cell which will be calculated later in the spreadsheet, then calculating twice will usually result in the correct value. If a calculation can't be performed, the cell will display asterisks ('****.**') instead of a number. You should inspect your formula to see what is wrong. You may have left your parentheses unbalanced, or perhaps you refer to a cell name that you haven't defined. Formulas Formulas are algebraic expressions similar to FORTRAN or BASIC expressions. Operations proceed left to right, according heirarchy (multiplication after addition, etc). Expressions may be grouped with parentheses. Values are included in an expression using the following notations: - a number, like '10', '-5', '2.34' RmCn - takes the value in the cell at row (m) column (n) Special case, either (m) or (n) can be '.', which means to use the current row/column name - takes the value in the cell with the given name. The following arithmetic operators are provided: + Addition p + q - Subtraction p - q * Multiplication p * q / Division p / q % Modulo (remainder from division) p % q MAX greater of two values p MAX q MIN lesser of two values p MIN q - Negate -p ABS Absolute value ABS(p), ABS p INT Extract integer portion INT(p), INT p SUM Sum of all cells in a row or column above/to the left of the current cell. SUM's format: SUM(RmCn) 'm' and 'n' can be: a row/column number '.' to specify the current row/column '*' to specify all the rows/columns above/to the left Any of the above formats for 'row' and 'col' can be combined except R*C*, which is invalid. Conditional Binary operators; these are entered as binary operators (one operand on each side) and give the second operand if the conditional test on the first operand is true, otherwise they give zero: ?EQ op = 0 7 ?EQ 3 = 0 0 ?EQ 3 = 3 ?NE op not = 0 7 ?NE 3 = 3 0 ?NE 3 = 0 ?GT op greater than 0 7 ?GT 3 = 3 -7 ?GT 3 = 0 ?GE op greater or equal 0 7 ?GE 3 = 3 -7 ?GE 3 = 0 ?LT op less than 0 7 ?LT 3 = 0 -7 ?LT 3 = 3 ?LE op less or equal 0 7 ?LE 3 = 0 -7 ?LE 3 = 3 Spread menu selections: "Project" Menu "Project/New": Erases the entire contents of the current spreadsheet. "Project/Load": Erases the entire contents of the current spreadsheet, then loads a previously-saved spreadsheet. This brings up a requester asking for the name of the file to load. "Project/Save": Saves the current spreadsheet into a file. Project/Save uses the same file name as the spreadsheet that was loaded, or if no file name has been specified, it puts up a requester asking for the name of the file to save to. "Project/Save as..": saves the current spreadsheet into a file. This puts up a requester asking for the name of the file to save to. "Project/Print": prints to a file a displayable image of the current spreadsheet. This puts up a requester asking for the name of the file to print to, which can be "PRT:" to print directly to the printer. (Note: background printing is not implemented, meaning that Spread will stall until the spreadsheet had been printed entirely.) "Project/About Spread": Try it and see. "Project/Quit": Leaves Spread. If a spreadsheet is loaded it will be lost; make sure you save it first if you want to keep it. The close window button in the upper left corner performs the same function. "Edit" Menu "Edit/Cut": The current cell is saved in the paste buffer, and becomes empty. (The 'current' cell is the cell the cursor is positioned on, which is displayed in reverse.) "Edit/Copy": The current cell is saved in the paste buffer. The current cell is not altered. "Edit/Paste": If the current cell is empty, then the contents of the paste buffer is placed in the current cell. "Edit/Erase": The current cell is made empty. It is not saved in the paste buffer, and the paste buffer is not disturbed. "Edit/Insert Row": The contents of all cells below and to the right of the current cell, including the current cell, are shifted one row down. The current cell and all the cells in the current row to the right are made empty. "Edit/Insert Col": The contents of all cells below and to the right of the current cell, including the current cell, are shifted one row to the left. The current cell and all cells below the current cell are made empty. "Edit/Delete Row": The contents of all cells below and to the right of the current cell are shifted one row up. The contents of the current cell, and of all cells in the current row to the right, are lost. "Edit/Delete Col": The contents of all cells below and to the right of the current cell are shifted one row to the left. The contents of the current cell, and of all cells in the current column below, are lost. Warning: If any cells use RmCn notation with actual cell numbers in a formula, and the target cell is moved by any insert or delete operation, then it's likely the formula is now incorrect. The cell name feature should be used when making references to cells in formulas, as name references are resolved regardless of cell locations. "Cells" Menu "Cells/Edit Cell Text": If the current cell is empty, it is made a text cell. The Text gadget at the bottom of the window is activated, as if you had clicked on it. Pressing the 'E' key has the same effect as "Cells/Edit Cell Text", or if the text gadget is not ghosted you may simply click on it to edit. "Cells/Edit Cell Formula": If the current cell is empty, it is made a formula cell. The Text gadget at the bottom of the window is activated, as if you had clicked on it. Pressing the 'F' key has the same effect as "Cells/Edit Cell Formula", or if the text gadget is not ghosted you may simply click on it to edit. "Cells/Edit Cell Name": The Name gadget at the bottom of the window is activated, as if you had clicked on it. Pressing the 'N' key has the same effect as "Cells/Edit Cell Name", or if the name gadget is not ghosted you may simply click on it to edit. "Calculate" Menu "Calculate/Evaluate": The formulas in the current spreadsheet are solved, and the results of the calculations are displayed in the formula cells. This is the way to cause calculation if Auto Calc is disabled, or if a calculation makes a forward referece to a cell (see 'order of calculation' above). "Calculate/Auto Calc": When this entry is checked, the 'auto calc' feature is enabled. Selecting this entry toggles it's state between enabled (checked) and disabled (not checked). "Format" Menu "Format/Set Column Width": This entry brings up a requester which allows you to enter the width of the current column, by the number of characters it should hold. "Format/Set Decimal Places": This entry brings up a requester which allows you to enter the number of digits to the right of the decimal point should be printed for formula cells in the current column. "Format/Set Normal Font": Selecting this entry causes Spread to use Topaz/8 for cell display. "Format/Set Narrow Font": Selecting this entry causes Spread to use the teeny/8 font for cell display. The teeny/8 font distributed with Spread uses 5 pixel wide character spacing, which can display up to 128 characters on the 640-pixel Workbench screen, although the border imagery around the Spread window allows only about 120 characters. If the 'teeny/8' font is not in your current fonts: directory, this menu selection will be ghosted. If you generate your own font and call it teeny/8, or copy another existing font to teeny/8, then Spread will use it with it's metrics. It should be an 8 pixel high font, but could be a wider or narrower font, fixed spacing or proportional. Spread will adjust accordingly. *****************************************************************************  MemoPad  MemoPad and CheckMemo are products which may be freely distributed on the condition that they are not altered in any way, either by omission or addition to the contents of the ARC file. The author welcomes comments, suggestions for improvement, and any praise you may have for this product. He may be reached at the following address: Michael Griebling COMPUTER INSPIRATIONS 150 Clark Blvd., Suite One Brampton, ON, Canada, L6T 4Y8 (416) 792-6797 In order to reward anyone wishing to be registered for a nominal fee of $20, for a limited time, a free upgrade will be given to the commercial release of MemoPad. Suggested list price of the enhanced program is $45. The commercial release is expected near the end of 1988. FREE upgrades to the commercial version will be made available to any users who have registered before this release date. Commercial Release Version ========================== In order to better support users of MemoPad we will be producing a commercial version which may be known under a different name -- yet to be determined. Our working name has been MemoPad V2.0. Due to a significant number of changes we may be forced to change the name to better describe this new product. Following is a partial list of planned features : 1) An address book facility with an automatic telephone dialer will be added. 2) A daily appointment utility will be supported which allows appointments to be booked at selectable intervals. 3) The original MemoPad functions will also be available along with a facility to allow batch processing to be invoked via a dated and timed memo item. 4) A speech facility will be added to allow memo items or appointments to be announced. 5) More options will be added to give more flexibility in selecting screen colours, methods of repeating memos and appointments, and in reporting matured items. 6) Text import/export into/from the address book, appointments, or memo items will be supported. Note that although all these additions are planned to appear in the commercial release we cannot guarantee that they will operate exactly as described above. Whenever possible we will attempt to improve on our offerings and thus the list above may become obsolete. Please contact us at the above address or telephone number to get up to date information. Installing MemoPad & CheckMemo ============================== There should be a total of 7 files for this program set. As soon as you invoked `ClickMe', all the names (if they were de-arced) were auto-magically expanded out, so you won't have to go through the usual hassle of EXECUTING the Execute.Me file that is usual in these cases. Install MemoPad as follows from the Command Line Interpreter (CLI) : (Make certain there is enough disk space to hold the copied files. The MemoPad disk icon should be named `MemoPad:'. Substitute the name/directory of the disk which is to hold the MemoPad utility in place of the dummy "Working Disk" name). FROM CLI : Copy MemoPad:CheckMemo to C: Copy MemoPad:MemoPad#? to "Working Disk" Copy MemoPad:CheckMemo#? to "Working Disk" Copy MemoPad:ClickMe#? to "Working Disk" Copy S:Startup-Sequence to S:Startup-Old Finally, in order to automatically invoke `CheckMemo' when the AMIGA is powered on, invoke your favourite editor to modify the following file : S:Startup-Sequence. Place the line `CheckMemo', without the quotes, near the end of this file, just before the line containing `EndCLI > Nil:'. Note: you can also manually check the memo items at any time simply by typing `CheckMemo' from CLI or by clicking on the CheckMemo icon. If nothing happens except a disk access when you invoke CheckMemo, don't worry -- it just means that no memo items were found for today's date. The MemoPad utility, which creates the memo items read by CheckMemo, was placed on your working disk as part of the installation. It is also possible to just drag the MemoPad icon over to your working disk. MemoPad Operation ================= MemoPad is a WorkBench utility which runs in a separate window on the WorkBench screen. It is capable of allowing you to generate memo items which are simply dated reminders of appointments, birthdays, holidays, or any to do list. Each memo item can be any length, limited only by the amount of memory or disk space where the memos are stored. When MemoPad is first invoked, it searches the S: startup directory for a file called MEMOPAD.DAT. This file contains all the memo items which have been entered by yourself. Naturally, the first time it is invoked, MemoPad won't find this file and will attempt to create one. At this time, you may get a message indicating that the WorkBench disk is required or that you should unprotect the write tab. During start-up, one other file is accessed : MEMOPAD.CUS. This file contains user customization information which allows you to customize the MemoPad operation to your individual preferences via the CUSTOMIZE menu selection in MemoPad. If this file is not found, MemoPad makes some assumptions and gives you a 24-hour clock, a day-month-year date, and a plain MemoPad title. Naturally, you can customize all these parameters and the next time MemoPad is invoked, all your selections will be used. By the way, the same selections will also be used by CheckMemo. Changing the Data File Directory ================================ We felt that everyone would have WorkBench in their drive during startup, so this is where MemoPad normally assumes it will find your memo items. If you don't like these files on your WorkBench disk, then it is possible to change the directory where MemoPad will look. device to some other disk. MemoPad and CheckMemo both accept an optional parameter on the command line which is the directory which they will use in place of the default S: directory. To change from the default simply edit the S:Startup-Sequence file again, replacing the `CheckMemo' line with `CheckMemo DIRECTORY', where DIRECTORY is replaced by a directory or device string. As an example, if we wish the MemoPad files to be placed on our working disk, WORK:, and in the MemoFiles directory, we would enter `CheckMemo WORK:MemoFiles' into the S:Startup-Sequence file. Whenever invoking MemoPad, you will also have to remember to specify the new directory in the CLI invocation line, so for our example, we would type : `MemoPad WORK:MemoFiles'. If invoking MemoPad and/or CheckMemo from the WorkBench, simply edit the INFO file from the corresponding WorkBench menu, after having selected either the MemoPad or the CheckMemo icon, and place the desired new directory specification as the first item in the `Tool Types' string gadget. Thus our example from above would require that the default tool type entry of `MEMODIR=S:' be changed to read the following instead : `MEMODIR=WORK:MemoFiles'. Don't include the quotes. Be sure to do this for both the MemoPad and CheckMemo icons. Operating Instructions ====================== Creating a Memo Item -------------------- Click on the ENTER button to create a memo item. The total number of memos should increase by one and the newly created item will be automatically assigned today's date. The comment field will be blank. To enter some text, just point to the line where the text is to be placed and click with the left mouse button. Then type the memo text. A RETURN will automatically take you to the next line of the comments. Comments longer than five lines can be created by clicking on the down arrow under the comment scroll bar. The scroll bar will reduce to half its original size. The text which is displayed represents those five memo lines located in the scroll bar range. Thus, if we created a new page of comments, we now have a total of ten comment lines available for this memo item. The scroll bar's position illustrates where we are within this ten line range. By clicking on the down arrow repeatedly, additional comment pages in multiples of five lines are created. New pages are created as soon as the scroll bar reaches the bottom of its container and the down arrow is clicked. The only limitation to the comment size is the amount of memory available. A help message will let you know when you run out of memory. The up and down arrows work in cooperation with the scroll bar to advance the comment window up or down by a single line of text. Click on the up arrow to move up a line and click on the down arrow to move down a line. Pages of five lines are traversed by clicking just within the scrolling container either under the scroll bar to move down five lines or above the scroll bar to move up by five lines. A trailing blank page of comment lines is automatically deleted once it is no longer visible. The scroll bar also changes its size and position to reflect the reduced number of comment lines. Blank page deletion occurs either when the scroll bar is dragged to the top of the scroll container or repeated clicks on the up arrow cause the blank page to scroll off the comment area. Viewing Memo Items ------------------ The date window, which normally is used to set a memo item's date, can also be used to display all the memo items for a given month. Just click on the VIEW button and all memo items for the current month will be highlighted in the date window. Any dates with more than one item will be outlined. To see the contents of one of these memo items, just click on the highlighted date. The related memo item will be displayed in the main window. (You may have to move or QUIT the date window in order to see the full memo text.) Multiple memos on a single date are displayed in a similar manner. Once the first memo item has been shown, the MORE button in the date window will light up to indicate that additional items are available. Click on the MORE button to see these memos one at a time. Printing Memo Items ------------------- The Print menu options give printer output from all the memo items or just the memo currently being displayed. By displaying only selected items, then invoking the single memo print option from the menu, it is possible to selectively print only those memos due for a single day. The amount of space on the left of the printed memo items can be altered by adjusting the printer left margin from within Preferences. Make certain that the right margin is adjusted so that sufficient space is available on the print line to contain a full line of comment text. Repeating Memo Items -------------------- MemoPad lets you specify repeated memo items which occur fairly regularly on a daily, weekly, monthly, or annual basis for a fixed length of time. To generate such a memo item, first you'll have to enable repeats by selecting one of the repeat choices in the REPEAT MEMO menu list. By default, repeats will be disabled as is shown by the checkmark in front of the "No Repeat" menu item. Choose one of the repeat options and use the NEXT or PREV buttons to get to the memo you wish to have repeated. Click on the DATE button, and use the Date Window controls to get to the starting date to be repeated. Click on the desired date. All repeated dates will now also be selected. Use the Date Window controls to check them if you don't believe it could be that easy. Click on the OK button to close the Date Window and accept the chosen date; otherwise, just click on the QUIT button to keep whatever date was originally on your memo item. Finding a Dated Item -------------------- The FIND button and the related menu item will let you find one memo out of the list of memo items which you have defined. Click on this button, use the Date Window controls to maneuver to the desired date, and click on the date to be found. Click on the OK button and the first memo item with this date will be located and displayed. This date search may be cancelled by clicking on the QUIT button. If the date is not found, a message indicating this will be displayed in the Help Window. A trick, which may be used to find any memo item in a given month might be to select the daily repeat for a month before clicking on the Date button. Any date which is selected will now cause a search throughout the entire repeat range for any matching memo item dates. Help Window ----------- The Help Window is a context sensitive help feature which displays help messages as various buttons and/or menu selections are made. It is located in the top rightmost portion of the MemoPad window. Automatic Memo Item Backup -------------------------- There is never any need to worry whether or not all your memo items have been saved to disk! MemoPad will automatically update the disk file, as soon as it notices that some memo item has been changed. Even if some other program should cause the AMIGA to crash in a shower of fireworks, you'll be secure in the knowledge that your memo items are safe. About the Modula-2 Source ========================= We, as a company, provide the source code for MemoPad and CheckMemo primarily to give interested individuals the tools for programming the Amiga using the Intuition-based interface in Modula-2. Included in the source are many examples of gadget-based control, menu initialization and use, window creation and manipulation, and requester window use. Although bits and pieces of what we do are available in other programs, we feel that having an example which unites all the working principles required to produce a full program is beneficial to novice AMIGA programmers. Our primary aim, of course, was to produce a program from which others could see how to work within an Intuition-based environment using Modula-2; and in this respect, we feel that we have succeeded. Acknowledgements ================ As always, there are a bunch of people behind the scenes who must be thanked for their contributions, either direct or indirect, to a program such as this. Firstly, thanks to TDI for their Modula-2 compiler, which may not be fastest or the best, but it certainly was the first. Secondly, thanks to all the people who have contributed public-domain programs to demonstrate Modula-2 concepts and give others source code examples upon which to build. In particular, thanks to Richie Bielak for his FastTextIO routines, used in this previewer and thanks also go to Jerry Mack for his TextTools module used in MemoPad. We also appreciate the artistic talents of Anna Lise Scheel, Colour Consultant, for her work on MemoPad. Thanks also to all the Beta test sites (you know who you are) for their assistance and helpful comments. Thanks also to the people who brought us PowerWindows which was used as a starting point for the design of windows, gadgets, menus, and requesters used in both MemoPad and CheckMemo. Although, the Modula-2 extensions to this program are VERY buggy and have been given inadequate thought, the tool has been useful. Finally, thanks to the makers of the Amiga -- without whom none of this would have been possible. Bug Fixes ========= Much as we hate to admit it, a few bugs crept into the V1.0 release of MemoPad and CheckMemo. Thanks to the people who pointed out the bugs (people tend to do that). All known bugs as listed below have been exterminated : Bug 1.0-1 The programs stomped over memory location 00000000 while starting up and initializing the Date window. Although this bug didn't usually cause the programs to crash, sometimes, if another program depended on something in memory location 00000000, a crash could occur. As a matter of fact, if both MemoPad and CheckMemo were running together (yes, they can do that too), closing down one would cause the other one to crash the Amiga. In our defense, the bug was traced to a pointer to a pointer which the current V3.0a TDI Modula-2 compiler doesn't seem to handle very well. PowerWindows forced us to use the awkward pointer to a pointer syntax (they must be `C' programmers!), hence our memory stomping. Bug 1.0-2 To our shock, we discovered that the DOS date was in error by one day (at least during this leap year). It worked fine last year. ;-) A new algorithm is now being used. To date no bugs have been reported for MemoPad V1.1. Please let us know if you find any in this V1.2 release. About Computer Inspirations =========================== Although COMPUTER INSPIRATIONS is fairly new to the AMIGA and other personal computers, we have gained considerable experience in software and hardware development from work in the aerospace industry and from a university environment. We are committed to bringing quality products to AMIGA owners at affordable prices. We will make certain that all our products reflect this attention to detail and we will respond promptly to any customer problems or concerns. Michael Griebling, President, COMPUTER INSPIRATIONS *****************************************************************************  USER'S GUIDE TO DWIP ====================  by Ken Van Camp (March 1988) Digitized Data Display Systems P.O. Box 878 Marshalls Creek, PA 18335-0878 Placed in the public domain by the author. ACKNOWLEDGEMENT: DWIP is heavily based on the jiff and plop programs by Jim Kent. Many thanks to Jim for writing a well-documented IFF file reader/displayer. This program would have taken me months to write without his code, instead of the two days that it actually took. INTRODUCTION: DWIP stands for "Daisy Wheel IFF Printer", and it is intended as a general-purpose IFF file printing utility for Amiga users who either (1) want to do graphics on their daisy wheel printer; or (2) just want to quickly make very large dumps of their IFF files. While it is true that most screen dump utilities will allow the user to blow up his image as large as he likes, it is generally impractical to blow up images to a very large size because of the time involved (not to mention expense in printer ribbons and wear&tear on your printer). I wrote DWIP because I wanted to create large banners quickly of files I had created on my Amiga. (Note that I use the word "quickly" in a relative sense. I think DWIP is about as quick as you can possibly get in making screen dumps with standard printers, but it still takes awhile to print a screen.) First, the good news: DWIP works with just about ANY printer. It just uses standard text characters, overstriking them in varying amounts to make different shades of grey. It does overstriking by first sending one entire line of characters, then a carriage return code (CR), followed by another line of characters and another until the desired darkness is achieved (up to 5 passes for the darkest shade). It only sends a line feed code (LF) when it is done with all passes over a given line. This is in keeping with the way the Amiga operates, sending out only a LF at the end of a line, which returns the carriage to its home position and also moves the roller forward one line. In normal operation, the Amiga doesn't use the CR at all, but most printers use the CR only to return the carriage without moving the roller. However, some will move the roller as well when they get a CR, and in that case DWIP will not work properly with the default settings. Here's what you should do to test DWIP: There is a "test" mode, which you invoke by typing: DWIP -z This will produce a file starting with the letters DW and having four more characters after that, in your RAM: directory. You can print that file on your printer, as in: copy RAM:filename to prt: What you should see is five lines, each one having 36 characters in it. (Actually, there are many more characters than that, but the ones toward the left should be overstruck to produce dark rectangles over the letter positions.) The five lines should all be identical and single-spaced, and they should look nearly black on the left and nearly white on the right. This is the DWIP grey-scale. If your test pattern doesn't look like this, chances are you're looking at about 25 lines of output instead of 5. In that case, your printer is moving the roller with every carriage return code. I would recommend checking your printer manual at this point, and see if there is a dip switch that controls the treatment of carriage returns. Disabling automatic linefeeds with every carriage return should make DWIP work properly, without affecting the normal operation of your printer with the Amiga. If you can't find such a dip switch on your printer, or if moving it affects your other printing with the Amiga, then there is one other possibility. There is a "universal printer" option on DWIP (-u) which you can try. It works by sending a bunch of backspaces at the end of each line, instead of a CR, so there's a chance this might work with your printer. (Actually, this option isn't as universal as I had intended, since some printers don't seem to backspace a full character width and the result is a real mess.) To try this option, use: DWIP -z -u and then use the copy command to print out the resulting file. (It will have a different name from the first one.) And if this doesn't give the 5-line test pattern I described above, you're out of luck. DWIP doesn't work with your printer. Now on to continue with the good news: A dot matrix printer will work just as well as a daisy wheel printer. I named DWIP for daisy wheels because this is the only graphics printing utility I know of for the Amiga that also works on daisy wheel printers. Also in the realm of good news, I'll tell you that DWIP has many options, allowing you to print any part of the screen on printers of any carriage width, either normal or sideways. It can even be used as a quick-and-dirty slide-show program (although it doesn't do fancy things like scrolls, fades or dissolves). Finally, DWIP can blow up a picture as large as you like, including generating more than one character on your printer per dot on the screen. That means you can make some very large banners from your IFF files, although of course you'll have to do some pasting as soon as you go beyond the width of your printer. (However, DWIP has a sideways printing option so you can print very long images in a single pass.) Now for the bad news: First of all, DWIP doesn't do color. It approximates the colors of the screen as shades of grey (you have control over that, too). Second, DWIP doesn't currently support all the IFF file formats. It is limited to low-resolution, non-HAM screens. (No interlace, overscan, PAL, high-resolution, or HAM files will work.) Third, it doesn't run from the workbench; you have to run it from the CLI. USING DWIP ========== The format for starting DWIP from the CLI is as follows: DWIP [options] files There are many options in DWIP, and any or all may be used in combination. All options consist of a minus sign (-) and a one-letter code. In addition, many codes are followed by a number (annotated as "val" below) or a string of characters (annotated as "string" below). Here is a summary of all the options: -lval set leftmost location on screen (default 0) -tval set top location on screen (default 0) -wval set width of screen area to print (default 320) -hval set height of screen area to print (default 200) -pval set printer pitch (default 10) -cval set # columns to use across printer (default 135) -nval set # lines per inch on printer (default 6) -istring set initialization string (default is none) -estring set end-of-line string (default is newline) -u "universal" printer option (use backspaces instead of CR) -ofile send output to named file (default is PRT:) -s print sideways -m "modified" picture (inverse intensity) -rval set red relative intensity (default 1.0) -gval set green relative intensity (default 0.7) -bval set blue relative intensity (default 1.0) -vtime view file for time seconds, instead of printing -z print a test pattern (after any named files) The default for DWIP is to make a copy of the entire screen on the printer using 135 columns (standard wide-carriage printer in 10-pitch). To zoom in on a smaller portion of the screen, you have to specify the coordinates of the left, top corner of the area you want, as well as the width and height of the area. For instance, if you wanted to print an area beginning 110 dots (pixels) in from the left edge of the screen, 200 dots wide, and beginning 50 dots from the top edge of the screen, 100 dots high, of an IFF file named "myfile", you would start DWIP with the command: DWIP -l110 -w200 -t50 -h100 myfile DWIP IS case-sensitive, so be sure to use lower-case letters on the options. File names are the same as standard AmigaDOS, so case doesn't matter there. To complicate matters, let's say you only have an 80-column printer. Then you would have to use the -c parameter to set the number of columns, as in: DWIP -l110 -w200 -t50 -h100 -c80 myfile Or suppose your printer prints in 12 pitch, instead of 10 (which DWIP assumes). You can specify the pitch with the -p parameter, as in: -p12 Or suppose your printer had a compressed printing mode that let you put 120 characters across a standard 8" printing area. Then you'd need the -c parameter (-c120), but you'd also need to change the pitch. Pitch is just the number of characters per inch, so you have 120 / 8 = 15. You can also change the vertical pitch (the number of lines per inch) with the -n parameter. The default is 6 (as in 66 lines / 11 inches), the standard for nearly all printers, but you can easily change this. You will notice that although DWIP gives you direct control over the width of the picture you will produce (via the -c parameter), you do not have control over the length of the picture produced. DWIP automatically selects a picture length to keep the aspect ratio of the screen as nearly as possible. The output file name DWIP chooses is intended to be a "unique" name. So it makes up a name that doesn't already exist in the RAM: directory and uses that. If you use DWIP several times, you have to be careful to delete these files or they'll pile up because DWIP never overwrites these files. The alternative is for you to explicitly tell DWIP the file name you'd like your output to go to. Use the -o option, and you can send the file anywhere you like. For instance, you can send the output to a file call "myoutput" on your hard drive with a command like: DWIP -odh0:myoutput [options] myfile You can even specify "prt:" as the output file, and then Dwip will automatically print it for you and you can skip the intermediate-file step. I don't really recommend this, however, since you can't stop Dwip once it starts printing. This is true if you try to stop it, or if your printer goes offline and the familiar "Printer Trouble" requester appears. Since Dwip itself is pretty fast, and the only slow step is the actual printing, you may want to do that step in the background, as in: run c:copy RAM:file to prt: By using the 'run' command, you can then go on and do other things while the file is printed. DWIP prints color pictures by estimating the brightness of each different color. The basic idea is to add the red, green and blue components of the color. This would yield a number in the range from 0 (black) to 45 (white) since each of the RGB components has a range from 0 to 15. However, I have made the observation that the green color on the Amiga is somewhat lighter than the red or the blue. You can see this very easily in Preferences by creating a screen with full green color and no red or blue, and comparing it to the corresponding red and blue full colors. Therefore, I call the red and blue "full darkness" colors, but green is only about 70% as dark. Note that I speak of darkness, not lightness. That's because DWIP starts with a white sheet of paper and adds darkness to the dots to create a picture. If you disagree with my choices, you can easily change them yourself. The -r, -g and -b parameters allow you to enter a decimal number (between 0 and 1) corresponding to the percentage of darkness for each component. The default is 100% (1.0) for red and blue, and 70% (0.7) for green. To give equal weighting to all three colors, just use -g1. You can effectively darken the entire picture by setting numbers slightly greater than 1 for the 3 parameters, or lighten it by using numbers less than 1 (but never less than 0). By default, DWIP sends no initialization string to the printer and only a linefeed character at the end of each line. You can change each of these, to suit the needs of your printer. For instance, you may want your printer to do a form feed before each picture, or you may want it to send an escape code to change the printer pitch. The format for specifying an initialization string is -istring where "string" is any string of characters. You can embed non-printing ASCII codes by specifying them in the form \nnn where nnn is a 3-digit decimal number for the ASCII code. (NOTE, C programmers, that even with a leading zero this number is decimal, NOT octal!) For instance, you can tell DWIP to send a form feed (ASCII code 12) before every picture by using: DWIP -i\012 myfile Note that all three digits (012) must be specified. Or if you need to send an escape, left-bracket ([), and 't' you would use: DWIP -i\027[t myfile You can set the end-of-line code sent by DWIP in the same manner. By default, DWIP sends only a linefeed code (ASCII 10), but with the -e option you can specify any string you like. Note that here I am talking about what DWIP does AFTER all overstriking is complete; only the -u option discussed above affects what is done DURING overstriking. You can print sideways by using the -s flag, or you can "invert" the image with the -m (modify) flag. By "invert", I mean printing the negative of the image, exchanging dark for light as in a photo negative. (This option really should have been flagged as -i or -n, but both of those letters were already being used for other options, so I was stuck with -m. Such are the perils of the English language. :<] ) Finally, if you use the -v option you can make DWIP act like a simple slideshow utility. The number after the v is the number of seconds to pause before bringing up the next picture. For instance: DWIP -v10 file1 file2 file3 would display each of the 3 files in succession, pausing 10 seconds between each one. This option stops any printing from being done at all; it is strictly for viewing files. One final note: all parameters to DWIP are order-dependent; they are evaluated as they are encountered, and can be placed in whatever order is logical for your situation. You can set and reset parameters in a single command line. For instance, you could do something like: DWIP -l20 -w200 -c80 -ofilout1 myfile1 -l120 -t100 -ofilout2 myfile2 This would use two different output files, with the picture for myfile1 being sent to filout1 and the picture for myfile2 sent to filout2. The -s and -m parameters are toggles, incidentally. Using them once in a command turns the option on; using them again turns them off, and so on. Happy printing! (:<) *****************************************************************************  Keyclick version 1.1  One thing I always missed about the Amiga was an audio click when the keys were pressed. While the Amiga keyboard has the best feel of any I've typed on, it doesn't have a form of audio feedback, which aids in touch-typing. Thanks to the multitasking operating system however, the addition of such a feature is relatively painless, both from a user's and a programmer's standpoint. Upon running the program, a window will be presented which contains two gadgets. The slider is used for adjusting the volume of the click. The toggle switch can be "pressed" to turn the sound on or off. After the program is up and running, an audio click will be produced at each press of a key on the keyboard or a mouse button. You cannot run more than one key clicker at a time; the second clicker that you run will indicate that a key-clicker is already active in the system. Simply close the window to end the program. That's about all you have to know as a user. For you programmers out there... This program demonstrates custom input handlers and effectively sharing the complicated audio device; two concepts that can be put to great use. The center of activity revolves around a custom input handler, which simply signals the waiting task when a key or mouse button event arrives in the input stream. Once the task is awakened, it sends a command to the audio device to initiate the click and goes back to sleep. Therefore, this program only uses a significant amount of processor time when a key or mouse button is actually pressed. I had the program set its own priority to fourty (this can be changed by assigning a different value to TASK_PRIORITY, defined at the beginning of the program) for better response. At lower task priority values, the program tended to be sluggish on occasion (especially in a busy system). The input handler priority (defined by HANDLER_PRIORITY) is set at fifty-one. This causes events from the input stream to be intercepted before Intuition gets ahold of them. This is desirable because Intuition "swallows" some of the events. That is, it removes some of them from the input stream, preventing the custom input handler from notifying the clicker task. At each stroke of a key, an audio channel is allocated, a sound request is issued to the audio device, and the channel previously allocated is freed. All of this takes place within the click() routine. After a channel is allocated (via a call to get_audio_channel()), the io_Unit parameter is checked to see if an allocation actually succeeded. A zero in this parameter indicates that no channel could be allocated. If this is the case, the click() routine returns immediately without attempting to ask the audio device to make a click sound. Any other value in io_Unit denotes which channel has been allocated for use. The IOAudio structure is prepared for a CMD_WRITE to issue a sound request to the audio device, and is executed with a call to BeginIO(). A WaitIO() call is immediately issued after the BeginIO() so the program waits until completion of the write request. This is needed to delay freeing the channel until the click sound is completed playing (after WaitIO() returns, a call to free_audio_channel() frees the previously allocated audio channel). An alternate method of audio manipulation would be to allocate an audio channel at the beginning of the program and set it to the highest possible priority (127) to prevent it from being stolen by other tasks requiring audio channels. However, this method does not take full advantage of the audio device's sophistication; it must be remembered that in a multitasking environment you have to share resources. Allocating and "holding on" to an audio channel is very uncooperative (and selfish!). The in-line assembly language at the end of the C source code is an input handler interface, which is required for the system to "communicate" with the custom input handler. In other words, it copies the appropriate system registers (A0 and A1) to the stack to conform with the input handler calling convention. This is absolutely essential if the system is to work correctly with the custom input handler. I would like to hear your comments on this program. Feel free to E-Mail me on GEnie (MMD) or Delphi (MOCKO). Note- a simplified version of this program (V1.0) can be found in the November 1988 issue of Amazing Computing. The program as it appears in print statically allocates an audio channel, therefore preventing any other task in the system from allocating (stealing) it. This version of the program dynamically allocates an audio channel at a priority of -90 each time a key is pressed, and works well with other tasks using the audio device (at least with my experiences). This version also adds a toggle switch to enable the user to prevent the program from clicking if so desired. If any problems are encountered in using this program, I'd like to know so I can upload updated versions. Thank you. -Mike *****************************************************************************