CL-Print Version 2.40 Caller Log Comment for PCBoard 14.x By Gary Meeker 05/03/92 ______________________________________________________ I looked at several programs to this job but they all used a fixed format or inserted their name in the comment. They were also written in C, Pascal or QuickBasic and were rather bulky for the job. All I wanted was a simple program to place any desired comment in the CALLER file. The program had to maintain the 64 character fixed length format (62 characters text,CR,LF) and a few substitutions would be handy, like /T for 'HH:MM' (current time), /D for 'MM-DD-YY' (current date), /A for ' at MM-DD-YY HH:MM:SS' and /L for 'MM-DD-YY (HH:MM)' (short cuts for current date and time in PCBoard formats). Also /S for 6 spaces (to make indenting easy) and // to actually include a '/' in the text. The result of this was CL-PRINT.COM written in assembly for speed and size. It is less than 1K in length so fits into 1 cluster on most drives. (1023 Bytes, that was tough to keep below as I added features.) Version 2 has grown, but remains under 2k (2045) which is still 1 cluster on most Hard Drives. Format: CL-PRINT filespec logstring Remarks: The filespec parameter may include a drive letter and a path in addition to the filename for the CALLER file. Logstring may consist of text characters enclosed within (double) quote marks or ASCII decimal codes whose numbers are separated by commas. (You may seperate enteries by a semi-colon or space also.) Example: To indicate the completion of the event you would enter CL-PRINT C:\PCB\CALLER "/SScheduled Event Ended/A" Example: To indicate a program logging on you might enter CL-PRINT C:\PCB\CALLER "/L PCBFILE.EXE 3.1á (Event) (G) BEGIN" or to enter 'á' you might use decimal code entry as CL-PRINT C:\PCB\CALLER "/L PCBFILE.EXE 3.1",225," (Event) (G) BEGIN" Anything within the quotes is included in the text string for the comment except the '/' character which is the substitute switch. The character following the '/'is also not included unless it is another '/'. If you need to include the double quote character itself, you can use decimal entry format or use single quotes to enclose the string. Whichever quote starts the string must be the same quote to end the string. Other than that they are interchangable and the line CL-PRINT C:\PCB\CALLER "/L PCBFILE.EXE 3.1",225,' (Event) (G) BEGIN' would be identical to the previous example. The best way to understand it all is to play with it. Just use a dummy filename for the CALLER filename so as not to bother it until you are ready. If the file does not exist it will be created (new with version 2). The substitute characters are /A for ' at MM-DD-YY HH:MM:SS' - Used mainly at the end of a comment /D for 'MM-DD-YY' - Used anywhere you need the current date /L for 'MM-DD-YY (HH:MM)' - Used mainly at the start of a comment /S for 6 spaces - Used mainly at the start of a comment /T for 'HH:MM' - Used anywhere you need the current time /* for 62 astrics - Used anywhere, will create a second line // for '/' - Used to include a '/' character /Q quiet mode - Used to suppress program output to console /N New file (don't append) - Used to start a new file /Z ASCIIZ - Used to suppress padding of Numeric Variables /B use BIOS Time & Date serv. - Used to read Real Time Clock instead of DOS The Substitute characters may be used inside or outside the quotes so CL-PRINT C:\PCB\CALLER /S,"Scheduled Event Ended",/A is identical to the previous example. New with version 2 is the ability to use @ variables (single letters, not the full word variables used in PCBoard, with the 128 character command line limit imposed by DOS, it wasn't worth trying to use the long variables). If the @ symbol is found in the command line, PCBOARD.SYS, PCBOARD.DAT & USERS files are read (in that order). PCBOARD.SYS & PCBOARD.DAT must be in the current directory so you may need to change to the proper directory before running CL-PRINT (New with v2.30 allows use of environment variables PCBDRIVE & PCBDIR to locate PCBOARD.SYS & PCBOARD.DAT). PCBOARD.DAT file is read only to obtain the location & filename of the USERS file. This eliminates the need to use any kind of config file for CL-PRINT or extra command line parameters to locate files & allows the full command line for generating the desired text. A lot of the variables probably will never be used but I included just about everyting I could to make everyone happy. You can even use CL-PRINT to generate a batch file that could then be executed. The Substitute Variables are @F - First Name (Proper Case 15 characters) @? - Password (12 characters) @N - User Full Name (25 characters) @C - City, State (24 characters) @B - Bus/Data Phone (13 characters) @H - Home/Voice Phone (13 characters) @D - Last Date On (MM-DD-YY) @T - Last Time On (HH:MM) @! - Expert Mode (Y or N) @P - Default Protocol - Single Letter @L - Last Dir Scan (MM-DD-YY) @A - Security Level Access (3 characters - Numeric) @# - Number of Times On System (5 characters - Numeric) @M - Time Spent on Last Call (5 characters - Numeric) @E - Expiration Date (MM-DD-YY) @X - Expiration Sec Level (3 characters - Numeric) @U - User Maintained Comment (30 characters) @S - Sysop Maintained Comment (30 characters) @R - Record Number (5 characters - Numeric) @G - Time User Logged On (HH:MM) @Z - Language Extension (4 characters) - or blank if default @* - Time Remaining (5 characters - Numeric) @V - Event Time (HH:MM) @= - FileName based on Users Full Name (useful in batch files) (up to 8 characters from First Name & 3 characters from Last Name, Only 0-9 & A-Z are used and any other character is changed to '$' to prevent illegal DOS filenames from being created.) Users with a single name will not have an extension on the filename. Users with more than 2 names will use the 2nd name for the extension. Examples: User Name FileName ------------------------- ------------ CHRISTOPHER JUDITH CHRISTOP.JUD SYLVESTER HALL SYLVESTE.HAL O.LENNOX DOOLEY O$LENNOX.DOO FRANCES BOBSMITH FRANCES.BOB J.R. HOLLY J$R$.HOL BOB ELY BOB.ELY LAWRENCE KESTELROT LAWRENCE.KES SAM O'PRY SAM.O$P JUNG-YUL LEE JUNG$YUL.LEE L. WILLARD L$.WIL GEOFFREY WARREN SPARK GEOFFREY.WAR WAYNE STEINARD TAYLOR WAYNE.STE ONELONGNAME ONELONGN. A A. Any other Character following the @ will be printed (but the @ will not, use @@ to print a single @ symbol). If /Z is used it must be used before any @ variables. It causes numeric variables not to be padded to the fixed lengths listed above (3 or 5 characters). Strings are always padded to full length. Example: CL-PRINT C:\PCB\MAIN\CALLER /Q,/S,"Last On: @D (@T)" or CL-PRINT C:\PCB\MAIN\CALLER /Q,/Z,/S,"Last On: @D (@T) for @M Minute(s)" This example when run in your $$LOGON.BAT comes in handy for CALLS.EXE along with the modifications I made to it (this will be available from my BBS as CL14S23A.ZIP), The entry allows the generation of a Report: -= Last Called In =- Within One Week: 59 (28.1%) ³°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°Û Previous Day: 44 (21.0%) ³²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²Û Same Day: 32 (15.2%) ³±±±±±±±±±±±±±±±±±±±±±±±Û Within Two Weeks: 18 ( 8.6%) ³°°°°°°°°°°°°Û Within One Month: 14 ( 6.7%) ³²²²²²²²²²Û Within Four Months: 9 ( 4.3%) ³±±±±±±Û New Users: 7 ( 3.3%) ³°°°°Û Within Six Months: 5 ( 2.4%) ³²²²Û Within Nine Months: 4 ( 1.9%) ³±±Û Within Two Months: 4 ( 1.9%) ³°°Û Within Two Years: 3 ( 1.4%) ³²Û Within One Year: 1 ( 0.5%) ³Û An Example of a batch file might be: CL-PRINT DOIT.BAT "/N/Q/Z@@ECHO OFF",13,10,"IF !@R!==!2000! COPY YEAH GEN\NEWS" NOTE: SHARE must be loaded if you intend to write to the CALLER log during $$LOGON.BAT or $$LOGON.BAT as PCBoard has the file open and has written entries to it prior to calling the batch files. If SHARE is not loaded you will write over the top of the entries PCBoard has made. Also, this can only be done on Network verisons /E & /U and you CAN NOT use it on /D or /S versions as PCBoard has the USERS file open in DENY READ/WRITE on these versions, so the file can not be opened by CL-PRINT to obtain the information desired. This is true in $$LOGON.BAT as well as PCBTEST.BAT, etc. As long as no '@' variables are used, there should be no problem writing messages to the CALLER log at these times though. Other uses for CL-PRINT would be to create batch files on the fly that can then be executed, such as a printer redirection using PC Magazines PRN2FILE CL-PRINT REDIRECT.BAT /N,'PRN2FILE C:\PCB\DL\@=' CALL REDIRECT.BAT IF EXIST REDIRECT.BAT DEL REDIRECT.BAT CL-PRINT DELETEIT.BAT /N,'IF EXIST C:\PCB\DL\@= DEL C:\PCB\DL\@=' The first line would create a batch file named REDIRECT.BAT containing the line PRN2FILE C:\PCB\DL\GARY.MEE if I was the User on the BBS at the time. And the second line would execute the new batch file. No trapping is done for illegal device names contained in the Users name at this time. If it is a problem, I can add it somewhere down the road. The 3rd deletes the batch file. The last line creates a batch file called DELETE.BAT and you would add the lines: IF EXIST DELETEIT.BAT CALL DELETEIT.BAT IF EXIST DELETEIT.BAT DEL DELETEIT.BAT to your $$LOGOFF.BAT to execute the batch file and then delete it. The batch file would contain the line: IF EXIST C:\PCB\DL\GARY.MEE DEL C:\PCB\DL\GARY.MEE Note: CL-PRINT always appends to the file specified, so if you don't delete it, it will continue to grow. New with v2.30 you can specify a /N to cause the file to not be appended. This will start a NEW file. --------------------------------------------------------------------------- License info ------------ CL-PRINT is copyrighted. You are hereby granted a license to use, copy, and distribute it freely provided no modification is made to the program or this documentation, documentation stays with the program and there is no charge for the service. You can modify it but don't distribute modified copies. This program is being released as Public Domain but if you want to send me money, I'll take it (gotta get another CD-Rom Drive for the BBS someway.) I have checked carefully to make sure that no combination of entries can lock up the computer, scramble the CALLERS log or otherwise create problems, but none the less make a backup before trying out this or any program. The program is distributed AS-IS with no warranty expressed or implied. It is the responsibility of each user to determine the fitness of this program. The author cannot be held responsible for damages caused by the use of the program. Any Questions, Comments or Requests for changes can be directed thru my BBS: SHARP Technical Support Line BBS (404) 962-1788 9600/2400/1200/300 24 Hours. via Fax: (404) 995-0613 or via mail: Gary Meeker C/O SHARP Electronics Corporation 725-C Old Norcross Road Lawrenceville, GA 30245 ACKNOWLEDGEMENTS PCBoard is a registered trademark of the Clark Development Company. I would like to thank Fred Clark and the Clark Development Company Program Team for developing such an outstanding BBS program and for their continued support to customers and third party software developers. History: 03-07-91 V1.00 Initial Release 02-14-92 V2.00 Added @ Variable subsitution & reading of PCBOARD.SYS, PCBOARD.DAT & USERS File if variable is used. Added file creation if file does not exist. 02-22-92 V2.10 Changed Mode files were opened in to avoid SHARE violations and added better error message displays to indicate just what error was occuring when opening a file. Also changed DOCS to explain the need for SHARE. 03-11-92 V2.20 Added @= for a FileName to be created from Users Name (8 characters from First Name & 3 characters from Last Name) 03-12-92 V2.30 Corrected @= variable to work on First names longer than 8 characters. Will now skip to the last name and pick up 3 characters from the last name. Also will translate illegal DOS filename characters (and more) to '$'. No checking is done for illegal device names so beware. Added Environment checking if the PCBOARD.SYS & PCBOARD.DAT files are not found in the current directory, then the DOS environment variables PCBDRIVE & PCBDIR will be checked and the file will be checked for in that directory. Added /N to start a NEW output file instaed of appending it. 05-03-92 V2.40 Changed routine to use DOS Time and Date services instead of BIOS routines for Real-Time clock. This allows use on XT units. Added /B switch to use BIOS routines as before. the /B switch must preceed any commands to display Time or Date entries. If you have trouble with Time & Date and it used to work, add the /B to the beginning of the entries. I don't have any computers that will not respond properly to BIOS Time/Date services 02/04 of Int 1Ah so I was not aware of any difficulties. Anyone with an XT that finds the program didn't work, but now does (ie. it doesn't work with the /B but does without it, let me know, so I know I have it working for everyone. (Yikes, running a BBS on an XT, how rude)).