pMod V1.1 , © 1990, 1991 by A. Zierdt ------------------------------------- What is pMod ? It's a useful tool that improves the abilities of the Amiga Printer-Device. Normally the Amiga OS will yield printer access only to one task at a time. Most programs with printer support open the device when they are started, whether you want to print something, or not. Therefore you may have some problems, under multitasking if you run several programs with printer support at one time, e.g. an debugger and an editor. You may not be able to print from the editor, because the debugger still locks the device. Another point is asynchronous printing, which needs a lot of programming experience, if done with the Printer-Device. And why has the Amiga no screen hardcopy, like the MSDOS stuff ? The answer to these questions is pMod. It performs asynchronous printing for multiple programs, which even includes the possibility to quit a program, while the print job is still in progress! It's easy to handle and of course supports ARexx. In addition it provides a hardcopy-function which buffers the actual screen before printing. Running pMod from CLI run pMod will start the printer-module as a resident process. pMod ? will cause the program to display the following text: "Usage: pMod [-s] | [-r] [-q]" Then, you may enter any valid command. pMod text.txt will print the file "text.txt". If pMod was active before entering this line, the print-request will just be transmited and the new invoked pMod will immediatley return to the CLI level. If not, pMod will stay active and therefore it will not return to the CLI, so that your current CLI will be useless! To avoid this, just use "run pMod... ". pMod fully supports the Amiga DOS conversation for filenames with one exeption: You must not use a hyphen as the first character, for "pMod -filename" will not be realised. pMod file -q will quit pMod after printing "file". pMod file -r will cause pMod to print the given file in raw-mode, i.e. no control-codes are replaced by standart ANSI codes. You may use this function to select print-modi, which are not supported by your printer-driver. pMod -q will quit a resident pMod. pMod -s will return a value of 0, if everything is fine with your printer and 5 if not. I.e. you can check your printer, e.g. during the startup-sequence: pMod -s IF WARN ECHO "Printer is not ready" ENDIF By the way, the -s option always implies a -q, so "pMod -s" and "pMod -s -q" are equal. Although this will not force any resident pMod to quit. To enable the hardcopy-fuction, you must create an environment-variable, named ENV:pMHCQ, with contains the raw-key-code of the key which is, in adition to , supposed to trigger the hardcopy. E.g., a value of 93 will enable + . (which is located on the numeric keypad) Running pMod from Workbench To invoke pMod, just double-click on its icon. There are two ways, to print a file: 1. While pressing , click on the icon of the file to be printed. Then double-click the pMod icon. 2. Use the Info-menu to set the default tool of the print-file to pMod. Then just double-click the icon of the file. You may use the Info-menu to set several tool-types: "Printmode = Raw" will force raw-printing. "Printmode = Once" will cause pMod to quit after printing. To choose both, enter "Printmode = Raw | Once". "HCQ = 93" will set the hardcopy-qualifier key to + . ARexx support The design of the pMod program-interface is compatible with ARexx. So any use should be quite simple. See the demofile modul.rexx for more information. pMod for developers You might want to use pMod with your own programs. To do so, first check wether it is always in memory, or not. Just seek for a public message-port named "prtModul.port". If it exits, you need nothing but to send an "OPEN" command in order to use the module. If not, you have to load pMod using LoadSeg and CreateProc. Then send a start message, using a WBenchMsg structure. It is important to set the sm_ToolWindow field to a value of -1! The start-message will then be returned immediately and after pMod has created the "prtModul.port", you can use it without any further "OPEN" command. To send a command to pMod, use a RexxMsg structure (128 Bytes). Offset 8 should contain a pointer to the commandstring which is to be null-terminated. The return code is located at offset 16 (a LONG value). Valid commands are: "PTXT",string will print the string. For example "PTXThello World" will cause pMod to print the string "hello World". "PRAW",string like PTXT, but without control code substitution. "KILL" will cause pMod to quit, as soon as the last print job is done. If no other task is using pMod, it will release the Printer-Device and really quit. Otherwise it will stay in memory just ending your printer access. "STAT" will return a status byte, with the folowing contents: Bit 0 set, if the last job is still in progress and the Printer-Device has not yet confirmed the IO request. In this case, the other status flags are indeterminated! Bit 1 set, if an error occured during the last job. Bit 2 set, if the printer is On-Line. Bit 3 set, if the printer is actually printing. Bit 4 signals Paper-Out. Bit 5 set, if the serial interface is used. Cleared, if the parallel interface is used. "VERS" will return the version number of pMod. "STOP" will cancel the current print job. Notice that the internal buffer of your printer will remain unaffected. "OPEN" will announce your program for using pMod. "FTXT" + APTR will load a file and print it out. APTR is a pointer to the filename. "FRAW" + APTR will do the same like "FTXT" without control code substitution. General remarks This program is PUBLIC, therfore it is freely distributable. It may also be used with commercial products, as long as this File is added. No fees may be charged for pMod ! Although, pMod was carefully tested, i don't make any warranty, for accuracy, completeness or usefulness of this document or pMod itself. Further versions of pMod may be commercial or not, please see for the corresponding Doc-File. Therefore source code is not available. I don't expect any donation, but if you write for more detailed information, please add some money for postage. Andreas Zierdt W-3406 Bovenden Thiestrasse 11 GERMANY