The Printer (tm) by Rob W. Smetana and Pro~Formance The Printer (tm) ** Version 1.4 (1/94)

---
Master Index Current Directory Index Go to SkepticTank Go to Human Rights activist Keith Henson Go to Scientology cult

Skeptic Tank!

--------------------------------------------------- ----------------------------------------------- ------------------------------------------- --------------------------------------- ----------------------------------- ------------------------------- --------------------------- ----------------------- ------------------- --------------- The Printer (tm) by Rob W. Smetana and Pro~Formance --------------- ------------------- ----------------------- --------------------------- ------------------------------- ----------------------------------- --------------------------------------- ------------------------------------------- ----------------------------------------------- --------------------------------------------------- The Printer (tm) ** Version 1.4 (1/94) ** Printer codes for hundreds of printers, that any programmer can use! Includes demo code for C, Pascal, Microsoft BASICs and PowerBASIC. ===================================================================== Copyright (C) 1989-1994, Rob W. Smetana All Rights Reserved 132 Alpine Terrace San Francisco, CA 94117 (415) 863-0530 The Printer, PDT, Pro~Formance and P~F are Trademarks of Rob W. Smetana ===================================================================== ===================================================================== Packing List ===================================================================== PRINTER DOC This manual CATALOG DOC A summary of our many programs TO-ORDER DOC An order form PRINTER EXE The Printer itself (database PLUS menu) EDIT EXE For users to edit or add printer codes AFTER they've selected a printer. PRINTER CFG The printer codes for the printer YOU selected. Your programs need ONLY deal with this 1, small file! * Created by Printer.Exe * Read by Edit.Exe (and the demo programs) DEMO EXE Reads Printer.Cfg and uses it's information to format text on YOUR printer. BE SURE to run Printer.Exe first and select a printer that's compatible with YOUR printer. PRINTER DAT A "structure file" used by our PDT program to help you view and edit printer code data files. This file, together with The_Prn.? files (see below) also explain the record structure of printer code data files. The next "pairs" of files -- for PASCAL, C and BASIC -- provide the record structures (The_Prn.?) and demo code. THE_PRN PAS Structure/Type declarations DEMO_PRN PAS Demo THE_PRN C Structure/Type declarations DEMO_PRN C Demo THE_PRN BAS Structure/Type declarations DEMO_PRN BAS Demo ===================================================================== THE PRINTER: Eliminating a Programmer's Nightmare ===================================================================== Our objective in developing The Printer was to help eliminate a nightmare many programmers face: printing formatted text on dif- ferent printers, with each printer requiring different instructions (ie., different printer codes). * If you want bold here, italics there, this phrase underlined, etc., you need the printer codes to "turn on" these options. * And if you distribute your programs, you'll often need printer codes for the dozens (or hundreds) of different printers your users have -- unless you want to limit your audience! Few programmers have the time and resources to obtain appro- priate codes for every printer. Fortunately, you don't have to: The Printer offers you codes for hundreds of printers. * And with The Printer, you can, in many cases, develop simple print routines you can use REGARDLESS OF WHICH PRINTER A USER SELECTS! * Finally, ANY programmer writing in ANY language can use The Printer. If you can read a fixed-length record, you can use The Printer. The Printer contains printer codes for over 720 different printers (over 160 in user-supported versions). For each printer, we al- located space for about 70 printer codes. Some of these are blank, "user" codes -- so you (or your users) can customize codes for specific needs, or we have room to expand into. Examples: Here's how The Printer can help. ------------------------------------------- In this package you'll find PRINTER.EXE -- a multi-purpose program and printer database in one. You (or your users) can use Printer.Exe to install a printer. And YOU can use it to expand the printer code database to its fixed-length format -- which you can then view and edit (more on this later). When used with your programs : : : * Just run Printer.Exe and select a printer from the menu. You can then review and edit the printer codes for that printer. * When you're satisfied with the codes you see, press F2 and we'll save to disk a small configuration file: PRINTER.CFG. Your programs need only deal with PRINTER.CFG! It'll contain most every printer code you'll need. To enable or turn on a printer feature, just print the appropriate "field." For example: continued . . . Examples (continued) Note: * Our examples use BASIC code for its simplicity. If you program in other languages, mentally translate these simple examples. * Our examples assume we already read Printer.Cfg using a structure or TYPE called "Printer." The file The_Prn.? has the complete record format of Printer.Cfg. * Our examples use "rtrim$," a BASIC function that trims trailing spaces from strings. Each printer code is allocated 14 bytes even though some codes are 1-3 bytes. Trimming the trailing spaces ensures we don't shift text right by printing excess spaces. To reset the printer: lprint rtrim$ (ThePrn.Initialize); To print Text$ in bold: lprint rtrim$ (ThePrn.BoldON); Text$; and back to normal: lprint rtrim$ (ThePrn.BoldOFF) To Underline Text$: lprint rtrim$ (ThePrn.UnderlineON); Text$; and back to normal: lprint rtrim$ (ThePrn.UnderlineOFF) That's it. It's that simple! While there are many variations on this logic (like loading codes into an array, then printing already- trimmed array elements), the simplicity remains. And if your user installs a different printer, your code need NOT change. Just read Printer.Cfg, with the codes for the new printer, and proceed as usual! ===================================================================== Packing List ===================================================================== If you have any questions about anything here, give us a call at (415) 863-0530. A few minutes on the phone could save lots of time. File Description ----------- ------------------------------------------------------ Printer.Exe. A multi-purpose program AND database that: * You may distribute along with your programs (if you wish) -- provided you have the registered version. * Compresses the printer database by about 85 percent. * Allows users to: - Select a printer from a menu. - Review and edit printer codes. - Save a small configuration file (Printer.Cfg) to disk with codes appropriate for their printer. YOU need only deal with this small "configuration file" to get all the information you'll need to drive your user's printer (for the most part). * Lets YOU expand the database to its full, fixed- record size and format. You may then view and edit it (using our PDT which we'll describe later?). Edit.Exe A program you may, if you wish, distribute with your programs. When you use Printer.Exe to select a printer, it saves to disk a small printer "configuration file." Should your users ever want to edit these printer codes, Edit.Exe is a small, fast way to do it. Printer.Dat This is a "PDT structure file" that, together with The_Prn.?, explains the field structure of the fixed- length files The Printer can create. "PDT" (the Pro~Formance Data Tool), is a terrific program that's ideally suited to viewing and editing data files. We could not have developed The Printer without PDT. Section III describes PDT more fully. The_Prn.? "Include files" (or units) containing TYPEs (structures) for both fixed-length files The Printer creates. Demo_Prn.? Demo programs ("?" = .BAS, .PAS or .C) showing how to read Printer.Cfg and display printer codes. Some- thing like this could prove useful in your programs. ==================================================================== A WORK IN PROGRESS ==================================================================== We consider The Printer a "work in progress," awaiting your feedback. If you find The Printer useful, or if you think it **could** be useful but isn't now, PLEASE take a moment and jot down some ideas to help shape the future of this effort. We, and other programmers we spoke with, are convinced this effort is worthwhile. But we're not yet sure which format to distribute printer codes in, and which tools to offer. Please help us shape the destiny of The Printer. Here are some issues we'd like your feedback on. * Printer.Exe can expand its compressed database into a fixed- length file -- so you can view and edit it, add or delete printers, add printer codes, etc. But currently, there's no way to re-compress the fixed-length file and re-create Printer.Exe. How valuable would that option be? * Printer.Exe lets users edit and add printer codes. Should it? * Printer.Cfg is saved as a fixed-length file. In this form one can easily use a TYPE or structure to read all codes in one gulp. But other formats could work as well: delimited, sequential, etc. All have advantages; which is preferable? * Some printer codes must be sent in a specific sequence. But a database, by itself, offers no clues as to the proper sequence. Would "Notes From The Trenches" help? Can you offer tips for printers you're familiar with? * The Printer contains no graphics-oriented printer codes since, by themselves, graphics codes without other information can be close to useless. Would a related product would help? * What about newly-added printers? Manufacturers release new printers every year. How can we best keep you up to date? * When printer codes are saved to Printer.Cfg, they're space- padded to 14 bytes each. Is this format easily usable in all programming languages? * Some codes contain Null (Chr$(0)). Is this a problem? * What tools would be useful in a "professional" package? To make The Printer accessible to all programmers regardless of their means, we've considered offering two registered versions: - A "plus" version with the basics. - A "professsional" version with optional features (like the ability to edit codes and re-create Printer.Exe). Reactions? Features? Options? ================================================================= CONTENTS ================================================================= The rest of this manual is organized into 10 short sections: Section I: Copyrights, License, Disclaimer, Registering, Distributing The Printer Section II: Installing The Printer; Quick Start Section III: Introducing PDT -- a "Must Have" for Programmers Section IV: What You MUST KNOW to Use Printer Codes Section V: Using Printer.Exe -- Use #1, Selecting a Printer Section VI: Using Printer.Exe -- Use #2, Expanding the Database Section VII: Using Printer Codes with "Placeholders" Appendix I: The Record Structure of The Printer's Data Files Appendix II: Using PDT to View and Edit ANY File Appendix III: Registering and Ordering ================================================================= ================================================================= Section I: Copyrights and Trademarks ================================================================= For information, contact: Rob W. Smetana Pro~Formance 132 Alpine Terrace San Francisco, CA 94117 (415) 863-0530 The Printer is Copyright 1989-1994, Rob W. Smetana All Rights Reserved Worldwide The Printer, The Pro~Formance Data Tool and PDT are Trademarks of Rob W. Smetana LaserJet is a Trademark or Hewlett-Packard Corp. Other trademarks belong to their respective trademark holder. ================================================================= Disclaimer and Limited Warranty ================================================================= We've made every effort to ensure the reliability and accuracy of this product. If you find errors in this material, or if you have comments, suggestions or requests, please contact us immedi- ately. But neither Rob W. Smetana nor Pro~Formance can assume any liability for damage that occurs because of usage of or reliance on this product. We warrant that any disks we send you will be free from defects in materials or workmanship for a period of 30 days from the date shipped. THIS SOFTWARE AND ALL ACCOMPANYING MATERIAL(S) ARE OFFERED AS-IS. EXCEPT FOR THE WARRANTY DESCRIBED IN THE ABOVE PARAGRAPH, THERE ARE NO WARRANTIES EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PAR- TICULAR PURPOSE, AND ALL SUCH WARRANTIES ARE EXPRESSLY AND SPECIFI- CALLY DISCLAIMED. IN NO EVENT SHALL Rob W. Smetana and/or Pro~Formance BE RESPONSIBLE FOR ANY INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS, EVEN IF Rob W. Smetana and/or Pro~Formance HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Information contained herein and in the printer database is subject to change without notice and does not represent a commitment on the part of Rob W. Smetana and/or Pro~Formance. ================================================================= License and Non-Disclosure Agreement ================================================================= Running Printer.Exe, using anything in this package, or registering for The Printer indicates your understanding and acceptance of the license and warranty herein. The software and printer code database described in this document are furnished under a license agreement. The software and database may be used only in accordance with the terms of that agreement. * No work derived from this material may be distributed in any form if it substantially or in part duplicates the functionality and/or objectives of The Printer and the printer database. * REGISTERED USERS: This product is licensed to you alone. You may make copies solely for the purpose of reasonable back-up of this package. You agree not to copy or transmit this material for any other purpose, except as provided for below, and further agree not to make it available to others through a network configuration. * REGISTERED USERS may use materials included here, and distribute Printer.Exe and Edit.Exe to clients and users of programs or code you've written, PROVIDED THAT: - You do NOT distribute, or allow to be distributed, the expanded, un-encrypted printer code database, or any significant portion thereof. By "significant" we mean 10 records or more. - You do NOT reveal to anyone the "password" required to expand the compressed, encrypted database. * REGISTERED USERS: Should you distribute, to users of programs you have written, your own version of the printer database, you agree to: - Encrypt the database such that no other person or program, save yours, can access it. - Not disclose to anyone the method(s) used to encrypt or de-encrypt the database. - Allow users of your programs access only to that reasonable portion of the database that serves their immediate needs. While it would be considered reasonable for a specific user or network to need access to printer records for 1-3 dif- ferent printers simultaneously, it would be unreasonable to allow simultaneous access to 10 printer records or more. * SHAREWARE VERSIONS may be used for 90 days so you may thoroughly evaluate how The Printer may serve your needs and those of your users. But you may not distribute any part of The Printer in any way except as provided for in "Distributing The Printer." ================================================================= Distributing The Printer ================================================================= Shareware distributors, bulletin boards and user clubs may distribute "user-supported" (or shareware) versions of this software provided that: * Your company name, literature, etc. do not promote or include the words "freeware" or "free" software -- which terms misrepresent "user-supported" software. Expressly prohibited from distributing any software by Pro~Formance, Rob W. Smetana and/or Brandon S. Smetana are: American Freeware, California Freeware and U.S. Freeware. * You include, unmodified, all files included with this software including: Printer.Exe, Printer.Doc, Edit.Exe, Printer.Dat, The_Prn.?, Demo_Prn.? and any other files mentioned in Readme.Bat or Packing.Lst. * You charge a "distribution fee" of no more than $8 (US). * You clearly state that continued use of "user-supported" software REQUIRES paying for the software. ================================================================= The Benefits of Registering; How we "Say Thanks" ================================================================= The Printer is NOT free software. It is neither "public domain" software nor "freeware." It is "user-supported" shareware. This software is Copyright 1989-1994, Rob W. Smetana. It is protected by both United States copyright law and international treaty provisions. Shareware versions of The Printer work just like fully registered versions except that: * Shareware versions of Printer.Exe and Edit.Exe remind you that they're unregistered and may not be freely distributed. * Shareware versions contain printer codes for over 160 of the most popular printers. To "say thanks" to those who register, we send them a database with over 700 printers. * All versions include an option to expand the database to a fixed-length version (so you may view and edit it). Shareware versions will write out about 50 records so you'll be able to clearly see how the full database may be viewed and edited. To Register Instantly: ---------------------- Call (415) 863-0530 with your VISA or MasterCard number. * This can cut 2-3 weeks off delivery time, since we needn't wait for your order to arrive by mail, and we don't have to wait 10 business days for checks to clear the bank. To Register by Mail: -------------------- Just fill out the order form at the back of this manual. * PLEASE NOTE that, because we offer so many programs, our order form has 2 pages. - Page 1 lists each program and the cost of each. - You fill in page 2, indicating which program(s) you'd like to order, and adding your name, address, credit card information (if appropriate) and so forth. * Mail your order form to: Pro~Formance 132 Alpine Terrace San Francisco, CA 94117 USA ================================================================= Section II: Installing The Printer; Quick Start ================================================================= Installing The Printer ---------------------- Copy these files to any path: (only Printer.Exe is required) Printer.Exe, Edit.Exe, The_Prn.?, Demo_Prn.? If you plan to expand the database to it's fixed-length format, we strongly urge you to get a copy of PDT to help view and edit it. If you do install PDT, be sure to copy Printer.Dat to PDT's special sub- directory: PDT.DIR. If you do, whenever you run PDT and open the fixed-length database, PDT will be able to automatically format your view of the database in logical rows and columns. See Appendix II. Quick Start ----------- We know you're anxious to begin, so try both of these. Then, BE SURE to read this manual later -- with information you MUST KNOW! * Select a printer: - Run Printer.Exe. The bottom of your screen will always have instructions on what you should do next. - Highlight a printer and press to "select it." - Review the printer codes for that printer; edit any you care to. - Press F2 to save your printer codes to Printer.Cfg. - Press F10 twice to exit to DOS. Now review Printer.Cfg -- using PDT or Demo_Prn.? that we included. Or use The_Prn.? or Printer.Dat as the basis of a program you write to review or try out the printer codes. * Expand the database to it's fixed-length format: - Ensure there's enough disk space for Printer.Dat: about 800k with registered versions; about 50k with shareware versions. - Run Printer.Exe like this: printer rws-54321 With registered versions, replace "serial #" with the serial number we sent you with your registered version. And share- ware versions will write out about 50 records to give you a feel for all features of The Printer. Now review Printer.Dat. Here's where PDT comes in v-e-r-y handy -- especially if you installed the PDT "structure file" (also called Printer.Dat) in PDT's special subdirectory. ================================================================= Section III: Introducing PDT (the Pro~Formance Data Tool) ================================================================= We've mentioned PDT before. And we'll mention it again, simply because it's the finest tool we've ever seen to view and edit ANY file -- especially fixed-length files like Printer.Dat, Printer.Cfg, dBase files, and random record files produced by any language. We could not have developed The Printer without PDT. Here's a brief overview of PDT. Appendix II explains how to use PDT to view/edit The Printer's files as well as other files you may have. * With PDT you can view and edit ANY type of file: dBase files, other types of data files, executable files (eg., .Exe or .Com files), EBCDIC files, ASCII files, font files -- any file. * You can view and edit ANY SIZE file -- up to two gigabytes! Jump from the top to the bottom of any size file instantly. And you can open up to 4 files at once. View and compare different files. Or work in different areas of the same file. Since each file can be up to two gigabytes in size, you can work with up to 8 giga- bytes of data at once! * You can manage database files like you've never been able to before. PDT offers unique features to help you manage dBase or ANY fixed-length record file (data or font files, etc.). - PDT detects dBase ".DBF" files, formatting your "view" of them so fields are automatically formatted out for you. - With other fixed-length data files (like those created by programs written in C, Pascal, BASIC, COBOL, etc.), PDT lets you easily and quickly define their "structure." - Once PDT knows the structure of a file, you'll be able to: -- Easily view and edit the file, tabbing quickly from field to field. You can even press a key to edit numeric fields stored in "packed binary" form. -- Mark blocks (either columns or records) and then: Export them, Copy them, Erase or Fill them, etc. -- Expand or Shrink the width of fields. And, if you like, PDT will automatically update the dBase header and its own "structure" files to reflect the change. * PDT even manages EBCDIC files -- like those found on, or downloaded from, large IBM computers. * PDT can also help you: - Repair files -- regardless of their type or size. - Determine a file's structure (record or field length, etc.). - Edit executable files (customize messages, options or serial #s). ================================================================= Section IV: What You MUST KNOW to Use The Printer Codes ================================================================= Slots for 70 Printer Codes -------------------------- For each printer we've reserved 70 "slots" for printer codes. About 17 of these are "expansion" or "user" slots. You can use these to add codes specific to programs you write. Or your users can custo- mize codes to suit their specific needs. And if we later add codes, we'll have room to expand into without disturbing what exists. Codes are Stored as Strings --------------------------- Printer codes are stored in string (or binary) format. You don't need to parse or decipher codes like 027, 064, 018. And instead of 11 bytes these codes would consume, we need only 3. But, if you expand the printer database to its fixed-length format (or if you look at Printer.Cfg) you'll find each printer code has been allocated 14 bytes -- the code plus trailing spaces (ASCII 32). This fixed-length structure simplifies editing, especially with PDT. In most cases, to use a printer's features, just send a code to the printer as-is -- after trimming off the trailing spaces. Be sure to trim ASCII character 32 only (see below). For example, to turn Italics on, a BASIC programmer might just read Printer.Cfg (using a TYPE or structure) and then: LPRINT RTrim$ ( ThePrn.ItalicsON ). Beware Character 0 ------------------ Some codes contain or end with ASCII character 0. It's CRITICAL that you don't interpret this Nul character as white space and trim it -- the code is meaningless without it. BASIC programmers: * DO use BASIC's RTRIM$ to trim blanks (Chr$(32)) from codes. * Do NOT use functions like Crescent Software's qpRTRIM or pdqRTRIM. Crescent's functions trim BOTH character 32 AND character 0 -- which could render some codes worthless! Note: Epson printers often accept printer codes in two different formats such as: "Escape + Chr$(#)" or "Escape + #" ("#" = a number). We've heard rumors some Epson compatibles dislike the 2nd format; so we standardized on the 1st. This renders such codes a little harder to maintain and edit (although PDT lets you enter any ASCII character). Placehoders (ASCII character 251: ) ------------------------------------- While you can use most printer codes as-is, a few codes require that you "fill in the blanks." Actually, you'll replace "placeholders" with appropriate code(s). For example, for most printers the database contains codes to switch to 6- or 8-lines-per-inch (8-LPI). But suppose your program needs finer precision -- you need to move down the page 3/60 of an inch. ("<" stands for ESCAPE -- ASCII character 27.) * An Epson "Alternate Line Spacing" code might look like: . To exit to DOS, press F10. To highlight a printer: - Press Down, Up, PgDn, PgUp, End or Home. - Or press the first letter of the manufacturer's name. For example, to view Epson printers, press "E." If "Epson" is not the first manufacturer whose name begins with "E," press "E" or Down or PgDn until you find Epson. Highlight your printer (or one close to it), then press . You'll then have a chance to review and edit the printer codes. NOTE: If your printer isn't listed in the menu, choose one that's close. Then review the printer codes and edit them as needed. And beware that your printer may appear 2 or more times -- if it emulates 1 or more printers. continued . . . Selecting a Printer (continued) 4. ONCE YOU SELECT A PRINTER, we'll display all printer codes we have for that printer. This gives you a chance to review or edit them. Press F10 to select a different printer or to exit. - To REVIEW printer codes, press Down or Up cursor keys. - To EDIT a printer code, press Down/Up to highlight a code, then press to indicate you want to edit it. Edit the code, then press again to accept it. 5. IF YOU CHOOSE TO EDIT A CODE, an edit window pops up. It identifies the code, and, if appropriate, alerts you if the code you're editing contains ASCII character 0. If you see this message, take care that you don't inadvertently delete Chr$(0) or replace it with a space (Chr$(32)). While editing printer codes: - Press Escape to enter Escape -- ASCII character 27. - Press Ctrl-2 to enter ASCII character 0. - To enter ASCII characters 1-31 or 128-255, hold down ALT, then enter the ASCII number on the numeric keypad. - Press Ctrl-Home to erase a code, or Ctrl-End to erase from the cursor to the end of the line. - Press to accept the code as edited. 6. WHILE REVIEWING PRINTER CODES : : : - Press F2 to SAVE printer codes. Printer.Exe will save the codes (as edited) to Printer.Cfg, and will then exit to DOS. You MUST do this before pressing F10, or any changes you've made will be erased. The database codes aren't changed. If "Printer.Cfg" already exists, we'll overwrite it! To prevent this, rename "Printer.Cfg" before running Printer. See Appendix I as well as The_Prn.? for information on how to read Printer.Cfg and use its codes from within your programs. And remember that we also included Edit.Exe in case you (or your users) need to edit the printer codes in Printer.Cfg. - Press F10 to return to the "select a printer" menu. There you can select another printer, or press F10 to exit to DOS. continued . . . Editing Printer Codes (continued) NOTES: ------ * Because Escape is a valid printer code, we use F10 rather than Escape to back up to the previous menu, or to exit to DOS. * Some printer codes contain ASCII character 0. Because this looks like a space (character 32), one must take care when editing these codes. And character 0 cannot be entered as other characters can. - If, when you select a printer code to edit, it contains character 0, we'll display a message urging you to be careful when editing this code. - IBM declared that Chr$(0) be entered as Ctrl-2! So we've adopted that "standard," such that it is. * Printer.Cfg is a 2k, fixed-length file with space for 70 printer codes and their labels. See the next section for details on using codes in Printer.Cfg. And see Appendix I for details on the record/field structure of both Printer.Cfg and Printer.Dat (the expanded, fixed-length database). * We have not built in an option to edit the labels associated with each printer code. In most cases this is okay. But the final set of codes will all be labelled "User" -- not very descriptive. Using Edit.Exe: Editing Printer.Cfg ==================================== We included Edit to serve a need such as this: * You distribute Printer.Exe and Edit.Exe with your programs. * Your users use Printer to select a printer, and then no longer want to consume it's 130k of disk space. So they delete it (keeping a backup in case they must install another printer). * But they may need to edit or add printer codes. So they keep the 9-k Edit.Exe around to edit Printer.Cfg. Edit works just like Printer.Exe does -- except you don't select a printer first. Edit reads Printer.Cfg (or aborts if Printer.Cfg isn't on the current path). It then displays the printer codes, lets you edit them, than asks you to press F2 to save them. Like Printer, Edit will overwrite Printer.Cfg when you save new codes. F10 aborts the edit, leaving the existing Printer.Cfg intact. Using Printer.Cfg in Your Programs ================================== Be sure to see Appendix I and demo programs (Demo_Prn.?). Printer.Cfg, the printer configuration file saved by Printer.Exe when you select a printer, consists of two, 1024-byte records. * Both records begin with a 44-byte header identifying the printer. Appendix I describes the header's layout. * The remaining 980 bytes consists of 70, 14-byte fields, 1 14-byte field for each printer code. - Record #1 contains descriptions (labels) for each code. - Record #2 contains the actual printer codes. We chose this record format to make it easy, from within your pro- grams, to display all 70 printer codes and their descriptions. Saving the labels will be especially useful when (if) we offer an option letting users change the labels as well as the codes. * With so many printer options to choose from, we've found it helpful in our own programs to display which printer options are available, and what users should do to invoke each. See Demo_Prn.?. for code that might give you a start here. * If you do display the labels and codes, you might want to offer users a printed description of each code. 14-byte fields con- strain what we can say. So users might benefit from something that translates our terse abbreviations into something meaningful. Both The_Prn.? and Printer.Dat include fuller descriptions of each code. Using the Printer Codes from Within Your Programs ------------------------------------------------- You can use the TYPEs (structures) you'll find in The_Prn.? to load printer codes from Printer.Cfg. Or, use any 1024-byte variable to read them. Or, read the 44-byte header, throw it away, then read a 980-byte record. Or set up a 70-element array, then just read (or parse) each code into an element. Finally, just trim trailing spaces (Chr$(32)) from a code and send it to the printer. * Remember to first scan codes for our "placeholder" -- . If it exists, you MUST replace it. NEVER send it to a printer. In a later section, we'll explain how to customize these. * Also, remember to leave Chr$(0)s intact -- in BASIC use RTRIM$, NOT Crescent's qpRTRIM or pdqRTRIM. Examples (using BASIC code) -------- These examples assume we used the Types/Structures in The_Prn.Inc to read printer codes. These examples use BASIC's "lprint" or "line print" function. * To INITIALIZE (reset) the printer to power-on mode: lprint rtrim$(ThePrn.Initialize); * To UNDERLINE text: lprint rtrim$(ThePrn.UnderlineON); Text$; lprint rtrim$(ThePrn.UnderlineOFF) * To print text in BOLD: lprint rtrim$(ThePrn.BoldOn); Text$; rtrim$(ThePrn.BoldOff) * To turn on 8 lines-per-inch (8 LPI): lprint rtrim$(ThePrn.LinesPerInch8); That's it! For the most part, it's that simple. And you needn't care which printer is installed, or whether users install a dif- ferent printer. ================================================================= Section III: Using Printer.Exe Expanding The Printer Database; Creating PRINTER.DAT ================================================================= Printer.Exe can create a fixed-length, random-record database. * A new file, PRINTER.DAT, will be created, requiring almost 800,000 bytes of disk space. If Printer.Dat already exists, we'll tell you so and quit. One way this might happen is if the PDT structure file by the same name exists on the current drive/directory (it should be in PDT.DIR, not where you are). NOTE: Shareware versions write out only about 45 records. So disk space requirements are much less. * Once expanded, you can easily view and edit Printer.Dat, add records (printers), change or add printer codes, etc. PDT is an excellent tool for this. * You can also read Printer.Dat from your programs. But doing so may needlessly consume lots of disk space. Using the ".Cfg" file from your programs is much more space-efficient. * Please note that once expanded, there's currently no way to re-compress the database and re-create Printer.Exe. - If you add printers, or add codes for certain printers, or change codes, feel free to send us the changes (in 1024-byte records, in the original field-format). PDT's Block Mark and Block Export options make this an easy task. - We'll be happy to consider re-creating Printer.Exe for you. To Expand the Database ---------------------- Verify there's about 1 million bytes of free disk space. Then type: printer rws-54321 (that's a hyphen). We WON'T verify that sufficient disk space is available -- YOU must. As the database expands, we'll show which record number we're on. Record numbers should fly by. If they slow to a crawl or stop, we probably ran out of disk space. Press Escape, then check the disk space. If it's 0, clear some space, then repeat the process. ================================================================= Section IV: Using Codes with "Placeholders" ================================================================= While we've tried to design The Printer to be almost painless, using some printer codes requires some work. Fortunately, these codes can also yield significant powers and benefits. We mentioned earlier that some printer codes contain "" (ASCII character 251) -- a placeholder for value(s) you must supply. "" should NEVER be sent to the printer. Instead, you must replace "" with a string value appropriate for your situation. Here are general guidelines for replacing placeholders and using these codes. To see some of these in action (and masterfully), capture-to-disk a document printed by WordPerfect or Microsoft Word. Then examine the file in PDT. To use some of these, you need formulas or need to know which units-of-measurement each printer uses. We've included guidelines for Epson printers and HP LasetJets. Later we may offer guidelines for other printers. Please note that, with some codes, it's not sufficient to know the printer is an Epson (or emulates one). Epson CHANGED the meaning of certain codes (eg., Line Spacing) when they introduced the LQ (24-pin, Letter Quality) printers. So the same printer code can yield different results if you're dealing with an Older 9-pin, a Newer 9-pin or a 24-pin LQ Epson. GENERAL GUIDELINES ================== * "<" means character 27 (Escape) as in " or, pdt printer.dat - IF you followed step 3 above, either command should yield a display of logical rows and columns. - Fields will be displayed in alternating colors. As you TAB from field to field, notice near the bottom of your screen: -- FIELD: will change to show you which field you're in. -- VALUE: will show the "value" of the field you're in. This is especially useful with packed binary numerics. - Press Ctrl-D. PDT will display column labels atop the file window showing what's ahead of and what's behind your cursor. Managing Other Files ==================== 1. Close the file (Ctrl-C), then open one of your own (Ctrl-O). If you have a dBase file, try it first. If your dBase file does NOT have a ".DBF" extension, press Alt-O and select "Force dBase" from the Options menu. 2. Now for some fun! Make a COPY of a fixed-length, random file with BINARY NUMERIC fields in it. Now open the copy (Ctrl-O). - Press Ctrl-L and enter the Record Length. - Press Home, then press F2. Press a letter indicating the Field Type: haracter, nteger, ong, etc. Press and enter a label or description. Press again, then move the cursor to the next field. Press F2 again, then repeat this process. Continue this until you have AT LEAST 1 numeric field defined. PRESS F4 and SAVE this structure -- with the SAME NAME as your data file. PDT saves it to PDT.DIR so it won't overwrite data. 3. Now move your cursor to a numeric field you defined (TAB or Shift-Tab can now get you there quickly). -- Note "Value" at the bottom of the screen. Now move up or down the column and watch "Value" change. -- Stop at some number and WRITE DOWN its value. Now press Ctrl-E (Edit ON), then press F6. Enter a new number and press . If you followed these steps, you should have just edited a packed binary field in easy-to-understand ASCII. When you pressed PDT saved the binary version to disk. -- Now press F6 again and enter the original number you wrote down. 4. Close the file (Ctrl-C). Now immediately re-open it. IF, in step 3 above, you pressed F4 to save the structure, PDT will open your file with everything mapped out for you! IF YOU FOLLOWED THESE SIMPLE STEPS, you've just seen two of PDT's most useful functions. * PDT can (with your help) turn almost any fixed-length file into logical, easily-edited rows and columns. You can TAB from field to field to view or edit fields. And you can easily determine or edit field values -- even packed binary fields. * PDT can "automate" this, provided you save structure files. Advanced Options ================ And if you're concerned that if you ADD printer codes to YOUR database, AND we send you an update, that you won't be able to merge your stuff with ours: * BE SURE to try Column Block Mark (Ctrl-M) then Block Copy (Ctrl-W). You can EASILY open your customized file in one window, then open an update we send you in another window, then simply paste an entire column (or 2, 3, or ? columns) of codes from one file and into the column(s) of another file! Also try: * Block Mark and Block Export. * Delete a record: With Edit on, press Ctrl-B to mark a record, then press . * Or try record insert: With Edit on, press Home then Insert. * Finally, open Sample_2.Dat and check out the EBCDIC options. Just to emphasize what's probably obvious by now, PDT does NO buffering. What you change is immediately written to disk. * That's the main reason it can help you edit ANY SIZE file -- up to 2 gigs. * That's also why we urge you to experiment on a COPIES of files. * And that's why Edit mode is OFF be default. You must turn Edit ON before you can change anything. To Register or Order ================================================================== Because we offer so many programs, our order form has 2 pages. Please read CATALOG.DOC for descriptions of each program. * THIS PAGE lists our programs and the per-copy cost of each. * THE NEXT PAGE is the actual order form. - On the next page, fill in the name of each program you're ordering. PLEASE BE CAREFUL here and use the names listed below. If we're not sure which program you're ordering, we may have to return you're order. - If ordering by Visa or MasterCard, fill in the section for credit card orders. BE SURE TO SIGN it. Program Name Per Copy ============================================================== Multi-Print $29 if ordered w/ ANY other program $39/$29 The Printer Programmer's Printer Code Database $49 Font Pak "Pro" Programmer's Fonts & Mouse Shapes $49 Font Pak "DOS" Hundreds of DOS text-mode fonts $29 PDT The Pro~Formance Data Tool $139 inform-Z Professional Forms Design/Database $49 Mail Call With MC Express $49 " " Without MC Express $40 Pro~Scribe & PS Express $39 P~F Presents Professional $79 " " Plus (with intro. copyright) $49 P-Screen Professional $49 " Plus $29 Pro~Stamp Stamp Collection Manager $29 Ram-Man RAM-resident Text File Browser $19 Sparkle AND Menu Magic $29 The Survey Catalyst $495 ================================================================= PACKAGE DISCOUNTS Call about quantity discounts & site licenses. ================================================================= THE WORKS! One of each program (except The Catalyst) $349 inform-Z AND Mail Call $79 P-Screen Pro AND P~F Presents (Pro versions of both) $109 ============================= TO ORDER ============================= For FASTEST delivery of your programs, CALL with a Visa/MC card number. F __________________________________________ M Rob W. Smetana Pro~Formance R __________________________________________ A T 132 Alpine Terrace San Francisco, CA O __________________________________________ I O 94117 (415) 863-0530 M __________________________________________ L Make checks payable Phone ( ) ______-________ Date ___/___/___ to: Rob W. Smetana ======================================================================= For Visa or MasterCard Orders ======================================================================= Credit Card Number: ________________________________ Expires: ___|___ Signature (Required for credit card orders): __________________________ Be sure your name at the top matches how it appears on your credit card. ============================================================ prn 1.4 == Name of Program or "Package" # of Copies Price/Copy Total ======================================================================= Multi-Print ($29 if ordered /w other pgm) _____ x $29/$39 = $_______ _____________________________________ ________ x ______ = $_______ _____________________________________ ________ x ______ = $_______ ======================================================================= Shipping & Handling: Total Number @ $4/copy (US/Canada) of Programs (and Copies) ----->> _____@ $8/copy (Elsewhere) $ ______ =============================+========================================= | Subtotal $ ________ INTERNATIONAL ORDERS: : : | | CA. residents, add 8.5% tax $ _______ * US funds only please. +-----------------------+----------------- * Money order, check drawn a | US bank, or VISA/MasterCard |TOTAL $ ________ =====================================================+================= WHERE did you got your copy of our program? _________________________ This helps us learn the best way to get new programs to you. And feel free to write comments and suggestions on the other side. Thank you.

---

E-Mail Fredric L. Rice / The Skeptic Tank