Jet Letter Technical Support

by Thomas Bougher 29. September 2010 22:06

The following is a recent question asked of Jet Letter tech support.

I have written a program that produces a few thousand pages of output and received a warning message that a line of text was too long but I don’t know where that occurred.  Is there a way that I can  enhance the warning message to include the line number or specific variable that would point me to the specific location so I can more easily check it out?”

The reply, “Use “ProcessWarnings” command in PSL. If you hi-lite this command – right mouse click – select Help – there are examples available on using this command.”

PSL user, “Thanks! This is just what I was looking for! And thank you for the good discussion this afternoon on how to approach my current PSL opportunity!  It was good.”

The question cited above, is an excellent example of two very important features of PSL.

The first is that of User Exception Functions.  The one cited is just one of many ways programmers can insure that their jobs run without errors – or worse yet run their jobs with errors that might not be detected.  Think of these as a collection of little programs (functions) designed to deal with potential problems.  A user could easily make a library of these functions to be used with every job.
The instructions for the one in question are:
processWarnings func
    func : Function
    Specifies a function to call when a runtime warning is issued.  The system will call
    the specified function after reporting the warning.  The function must have four
    arguments :
    message: The warning message that has been sent to the console
    lineNumber: The line number in the script where the condition was detected
    fileName: The name of the script file in which the condition occurred
    recordNumber: The merge record (if any) that was being processed

    The system will pass the appropriate values to the function.  If there is no merge file

    the "recordNumber" will be zero.
A host of such functions are available for such matters as running out of space in a bounding box (such as a page), beginning and end of a document or a page and completion of a (merge) file.

The functions that might be evoked are not limited except by one’s imagination and abilities. They might include, for example sending an e-mail to someone. 
The second feature illustrated is a touch less obvious.  This person asked for help in approaching a particular job.  Our support in such matters, we feel, is a very important “feature” of PSL.  Ask us for our help.  It’s part of your annual support and we enjoy the opportunity to help and share our expertise

Tags: , , ,

Blog

Comments are closed
 

Copyright © 2011 JetLetter Inc. All Rights Reserved.
Home | Products | About Us | Support | Solutions