ERROR LOG UNIT Copyright 1995 By Bob Dalton INTRODUCTION: ------------ One of the most frustrating things about being a door author is having to deal with the people who send you a message that the door program is not working but do NOT give me sufficient information on WHY it is not working. This unit will help you by providing an error.log when the program crashes or aborts for some reason. Just ask your door users to send you any error logs which might be generated by your program. This unit has helped me pin down, almost exactly at times, some of the bugs which rear their ugly heads in my doors on occassion. The ELOG.PAS code included in this archive is FREEWARE and can be used in any manner you want and without cost, but remains copyrighted to Bob Dalton, along with anything else in this package. REQUIREMENTS: ------------ At this point in time the only requirements are that you must be using Borland Turbo Pascal version 6.0 or 7.0. I compiled the unit with Borland Pascal 7.0 Professional and know it works. I expect it will with TP 6.0 as well but can't guarantee it. Files Included -------------- Below is a listing of all files for the ELOG.ZIP Package: ELOG.DOC - The text file you are reading. ELOG.PAS - The Error Log routines unit by Bob Dalton. Installation and Preparation for Use ------------------------------------ 1. Move the archive package to a temporary directory and "unzip". 2. Before compiling the ELOG.pas unit be sure that your compiler knows where to find the listed units. 3. Add ELOG to the "Uses" portion of your program and call the procedures as needed and shown below. Only two lines in your main program code are required to make the unit work with your program. SaveExitProc:=Exitproc; <------ Must be first to make it work ExitProc:=@MyExit1; <------ Must be second to make it work 4. That's it! Enjoy and good luck. 5. Replace "uses DDPlus" with "Use DDPlusR" if you are using RipLink and also uncomment those portions of the ELOG.PAS unit which pertain to RipLink. 6. Make sure you include you save game procedure call in the places shown in the ELOG.PAS unit! 7. Still have questions? The RipDoor demo program in the RIPLINK portion of the DDplus package and the LDEMO demo program in the LOCKING portion of the DDPlus package both have working examples of the elog unit in action. Both also come with source code you can look at to see how it was done. TO USE THE ELOG.PAS UNIT ------------------------ FUNCTION FILE_EXISTS - Detects if a DOS file is present in the same directory. Returns true if it is and false if it is not. PROCEDURE TERMINATE--| PROCEDURE TRAPEXIT---| All three of these work together to trap an exit PROCEDURE MYEXIT1----| and redirect it so that an error.log is created that's can tell you what happened and why. Makes debugging a lot easier. Just make sure users send you the error.log when they report a problem. Here is a sample of the first several lines of my main program which shows you how to make the ELOG unit work in YOUR program: BEGIN (*** M A I N ***) SaveExitProc:=Exitproc; <------ Must have this first to make it work ExitProc:=@MyExit1; <------ Must have this second to make it work GetDate(Year,Month,Day,DOW); INITDOORDRIVER('GOC.CTL'); PROGNAME:='GODFATHER OF CRIME by Bob Dalton'; etc....