` Testing for results after Fetch (Jim Katz ) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

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 April 19, 2024, 12:06 pm
This article has been viewed 35105 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: