` 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  

Par2: Testing for results after Fetch
1998-01-23 -- Jim Katz
 
The Methods, Access:FileName.Fetch or Access:FileName.TryFetch are actually functions, that is they do have return values that you can test for. They are declared with the proc attribute so you don't have to use them as functions. If you use the TryFetch method you can test for which error has been returned using the old ErrorCode()and Error() functions: If Access:MyFile.TryFetch(My:key) Message('Errorcode is ' & ErrorCode() ! or If Error() = 'Record Not Found' Access:MyFile.ThrowMessage(FileErrorCode(),'Record Not Found') End Else etc.. Be aware though, there are some known problems when using the Fetch or Tryfetch methods with some file drivers. Check back through the Topspeed list, I think, it has to do with Get(File,key) on certain drivers, which is what fetch is doing.


Today is November 21, 2024, 6:17 am
This article has been viewed 35200 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: