ABC Bug Reports and Suggested Fixes
 

Disclaimer : The following bugs, and their solutions, have been posted here in good faith. While every effort is made to ensure they are both accurate, and regression free, they are presented "as is". Use at your own risk.

Tip : Some, if not all, of these require editing the ABC class files. We recommend you keep a copy of the original source files handy. You may need to restore the original source files before applying 5.5 patches.  Also any changes you make to the source files may need to be changed after you apply a Clarion patch.


Bug Number : 1

Summary : ErrorClass is used incorrectly from FileManager class

Date Reported : 23 June 2002

Status : Current in 5.5g

Effect on program : Error messages often report the wrong filename when reporting file errors. Any of the errors containing %file (in ABERROR.TRN) may be affected.

Reason :

1) In the error class is a property .FileName. This is used as a substitution for %file in error messages.

2) .FileName is private and can only be set via the .SetFile method.

3) the Setfile method is only called from FileManager.SetThread as well as ErrorClass.ThrowFile

4) Errorclass.Throwfile is only called from template-generated code in the process procedure.

5) FileManager.SetThread is called from a number of places in fileManager including,
.Close, .GetError, .GetEOF, .OpenServer and .UseFile

6) The main route to viewing an error, via the file manager, is the FileManager.Throw method. This is called from a large number of methods. For the vast majority of these calls the filename is NOT refreshed because SetThread / SetFile / ThrowFile are not called.

7) Thus for the vast majority of cases ErrorClass.FileName is not set correctly.

Recommended Changes :

There are obviously a number of possible ways to rectify this problem. the one I used was to add

self.errors.setfile(self.filenamevalue)

to the top of the 3 filemanager throw methods. ie in AbFile.Clw

FileManager.Throw PROCEDURE
CODE
  self.errors.setfile(self.filenamevalue)  ! bj
  RETURN SELF.Errors.TakeError(SELF.Info.LastError)

FileManager.Throw PROCEDURE(USHORT ErrNum)
CODE
  self.errors.setfile(self.filenamevalue)  !bj
  SELF.SetError(ErrNum)
  RETURN SELF.Throw()

FileManager.ThrowMessage PROCEDURE(USHORT ErrNum,STRING Me)
CODE
  self.errors.setfile(self.filenamevalue)  !bj
  RETURN SELF.Errors.ThrowMessage(ErrNum,Me)
 


Back to ABCBook index page.