## SET EXPERT ON by P.L. Olympia, page 76



Expert Listing 1


SET PRINTER TO FILE wnetlog.bin
SET PRINT ON                   && Required by FoxPro
???"{235}Z{2}{0}{13}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}"
???"{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}"
???"{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}"
???"{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}"
???"PSQRVW{30}{6}{139}{243}{14}{7}{191}{6}{0}{38}{198}{6}{5}{0}{0}{185}P"
???"{0}{172}{10}{192}t{13}{170}{38}{254}{6}{5}{0}{38}{255}{6}{2}{0}{226}"
???"{238}{14}{31}{190}{2}{0}{191}Z{0}{180}{227}{205}!{7}{31}_^ZY[X{203}"
SET PRINT OFF                  && Keeps FoxPro happy
SET PRINTER TO



EXPERT Listing 2



PROCEDURE ErrLog
* PROCEDURE ....... : ErrLog
* AUTHORS ......... : The KAT Team
* VERSION ......... : $Revision$
* LAST EDITED ON .. : $Date$
* LANGUAGE ........ : All Dbase dialects
* NOTES ........... : Writes a message consisting of the User-ID, Screen
*                   : ID, Module number and Error Number to
*                   : the Novell NET$LOG.MSG file.
*                   :
* CALLING SEQUENCE  : DO L_FulErr
PARAMETERS C_Screen, C_Module
* C_Screen is the Screen ID, C_Module is the application module no.
* Sample call:  DO ErrLog WITH "3.2.2","12.2b"

*-- Assuming that the Novell Login Script has defined an environment
*-- variable called USER containing (obviously) the user's name
    Name = GETENV('USER')

*-- Formulate the Msg making sure data is in SDF form
    User   = Name + SPACE(20 -LEN(Name))
    Scrn   = C_Screen + SPACE(10 - LEN(C_Screen))
    Module = C_Module + SPACE(8 - LEN(C_Module))
    Err    = STR(ERROR(),5)

*-- Load, then call, the .bin file
  LOAD WNETLOG
  CALL WNETLOG WITH User + Scrn + Module + Err

*-- Remove .bin from memory
  RELEASE MODULE WNETLOG
  RETURN



EXPERT List 3


PROCEDURE L_FulErr
* PROCEDURE ....... : L_FulErr
* AUTHORS ......... : Kurt, Chito, MIPS and LRAP Teams
* VERSION ......... : $Revision$
* LAST EDITED ON .. : $Date$
* LANGUAGE ........ : Primarily FoxBASE+ or FoxPro, Any Dbase dialect ok
* FILES USED ...... : Creates error log text file.
* MODIF. HISTORY .. : $Log$
* NOTES ........... : Called by L_ERROR.PRG, the standard ON ERROR trap
*                   : routine, to write a full error report onto a disk file
*                   : which will be collected by HW using CC Plus.
*                   :
* CALLING SEQUENCE  : DO L_FulErr
* PARAMETERS ...... : None
***************************************************************************

* Make sure users can't escape until the error log file is closed.
SET ESCAPE OFF

* Create unique error log report file name. This uses Fox's SYS(3) function
* which generates a unique filename. Modify for other Dbase dialects
ErrFile = AdminPath + '\ER' + RIGHT(SYS(3),6) + '.' + UserInit

* Open the file as the print device.
SET PRINTER TO FILE &ErrFile  && USE !PRN2FILE &ErrFile for Fox+,dB3+,etc

SET PRINTER ON
SET CONSOLE OFF

* Begin printing error report.
? '****** FATAL ERROR REPORT *******'
?
? 'Software/Version Currently running: ' + VERSION(1)

? 'Error Number:  ' + LTRIM(STR(ERROR()))
? 'Error Message: ' + MESSAGE()
? 'Error Line:    ' + MESSAGE(1)
? 'Date: ' + DTOC(DATE()) 
? 'Time: ' + TIME()
? 'Name: ' + UserName
? 

? 'SCREEN DISPLAY AT TIME OF ERROR'
? '-------------------------------'
?
* Execute a print screen to the file.
LOAD PRTSC
CALL PRTSC
RELEASE MODULE PRTSC
?

*--     Program nesting data uses Fox-specific SYS function calls
*--     Modify for other dialects
? 'PROGRAM NESTING AT TIME OF ERROR'
?
* Loop through the FoxBASE/FoxPro SYS(16) function values.
I = 1
DO WHILE LEN(SYS(16,I)) <> 0
   IF I = 1
      ? 'Master Prg: ' + SYS(16,I)
   ELSE 
      ? SPACE(I) + 'Called to: ' + SYS(16,I)
   ENDIF
   I = I + 1
ENDDO
?
?

? 'LAST 200 LINES OF CODE EXECUTED (if not running Runtime version)'
?
LIST HISTORY TO PRINT
?

? 'PROGRAM STATUS AT TIME OF ERROR'
?
LIST STATUS TO PRINT
?

? 'ACTIVE VARIABLES AT TIME OF ERROR'
?
LIST MEMORY TO PRINT

* Close the error log file, etc.
SET CONSOLE ON
SET PRINTER OFF
SET PRINTER TO
SET ESCAPE ON
RETURN
