Here is a procedure I use to Log errors to a unique file.
I would like to be able to list memory to file at the time
of the error. Also I want to append the error info to one 
file as appose to creating a file each time.
This program has been great for logging errors while I am 
away from the site. 







* syntax 
*on error do errorprint with message(),lineno(),program(),message(1)


procedure errorprint
PARAMETER m.messg, m.lineno, m.program,m.messg1
newfile = sys(3)+'.txt'
errfile = fcreate(newfile) && create unique file


IF errfile < 0						&& Check for error opening file
	WAIT 'Cannot open or create output file' WINDOW NOWAIT
ELSE		&& If no error, write to file
	=FWRITE(errfile,dtoc(date())+" "+time()+chr(13))
	=fwrite(errfile,sys(0)+chr(13))
	=fwrite(errfile,'Error Program- '+m.program+chr(13))
	=fwrite(errfile,'Error Line # - '+str(m.lineno)+chr(13))
	=fwrite(errfile,'Error Line   - '+m.messg1+chr(13))
	=fwrite(errfile,'Error Message- '+m.messg+chr(13))
	ENDIF
=FCLOSE(errfile)							&& Close file
*MODIFY FILE &newfile NOWAIT			&& Open file in edit window
return



Thanks for any input


Troy Young

102141,1023