Data Access Worldwide Knowledge Base
Article ID 2200 Article Title QUESTION: Do I need to manage the Found indicator when augmenting Request_Find Article URL http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=2200 KBase Category VDF (GENERAL) Date Created 12/21/2005 Last Edit Date 12/21/2005
Article Text
QUESTION:
I pretty often augment the Request_Find procedure in a DDO to do some other things. For instance:
// Request_Find
Procedure Request_Find Integer iFindMode Integer iFile Integer iIndex
Forward Send Request_Find iFindMode iFile iIndex
Send DoSomethingElse
End_Procedure // Request_Find
However, in Data_Set.pkg the FOUND indicator is queried after the find. If it is false, a FindByRowID is sent to refind the original record. But because of this, the global buffer was cleared and this caused an unwanted side-effect in my program.
So my question is: Am I supposed to reset the FOUND indicator in each and every Request_Find procedure I augment?
ANSWER:
Request_find in DDs must return the found indicator to indicate if a find worked or not.
So, yes, if you are augmenting Request_Find and "DoSomethingElse" might change the indicator, you will need to maintain (save and restore) the Found indicator as in the example below:
// Request_Find
Procedure Request_Find Integer iFindMode Integer iFile Integer iIndex
Forward Send Request_Find iFindMode iFile iIndex
Boolean bFound
Move (Found) to bFound
Send DoSomethingElse
Indicate Found as (bFound)
End_Procedure // Request_Find
Contributed By:
John Tuohy
Company: Data Access Worldwide
Web Site: http://www.dataaccess.com
Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.
The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.