` Comment on an Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Add a comment to an Icetips Article

Please add your comments to this article. Please note that you must provide both a name and a valid email address in order for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!

Your Name:  
Email:  
Header text/Subject:  

Please enter your comment in the box below:

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

SQL Related Articles: Better SQL Part 5
2002-07-24 -- Dan Pressnell
 
In the demo app at http://www.icetips.com/downloadfile.php?FileID=59 , the generic SQL work file sqlfile is declared in the dictionary. That makes it convenient to use in multi-app programs.
 
But if you go to the project settings for the app and turn on debug mode for compiling, you start to get an error when you run the program. The FileManager class for sqlfile tells you (over and over) that you haven't called the close method.
 
Because sqlfile is a special utility file, the ABC methods are not applicable to it. But the templates will generate a class for it anyway, because it's there, and one of the things the class does is register a callback interface. That callback interface intercepts the close() procedure (the runtime close procedure, not the class's method), and determines that you are not using "correct" ABC. In this case, the assumptions that the FileManager class is making are wrong.
 
Fortunately, there is a one-line fix to this. It appears that FileManager registers the callback interface only once. You have to unregister it once, and all is fixed.
 
Somewhere after your program starts, put this line:
  callback(sqlfile, access:sqlfile.filecallbackinterface, 1)
A good place to put it is in the AppStartup procedure.
 
That will unregister the callback interface that the FileManager registered for sqlfile, and you won't get the error message any more. I haven't seen any bad side effects from this.


Today is November 23, 2024, 2:23 am
This article has been viewed 35245 times.
Google search has resulted in 8 hits on this article since January 25, 2004.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: