Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FPD25, Seek and Locate both have same bad results in sp
Message
 
To
09/05/2003 16:04:16
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00786678
Message ID:
00787009
Views:
16
The _gotop() function in seekchild() has just that and I have used it with SEEK() and LOCATE commands. Sounds silly but both of them didn't work.

See my other reply for more trials and tributlations <g>.

>Try this:
>
>SELECT (m.zchild)
>m.zsavorder = ORDER()
>
>m._vsoerror = "docid"
>SET ORDER TO TAG docid
>LOCATE
>
>*--rest of code
>
>
>
>>Hi all
>>
>>I know this may sound repeating, but it happended. The following code failed only one single time and even LOCATE could not give the right results. I have tried recreating index but failed.
>>
>>
>>IF seekchild("m", "a09ssale")
>>	SCAN WHILE relatedchild("m", "a09ssale")
>>...etc...
>>
>>
>>The following are the codes in my framework. They work regularly but failed once and wont correct itself. The problem being that say out of 10 children records the following code in this special case starts with the second record always of the 10. Even locate gave me the same result, located the 2nd record. When I view these 10 records in the browse window all 10 of them show. In solution I changed the above SCAN WHILE to SCAN FOR and this one record started getting involved again. Any advise what I might have done wrong, which happens only once that even locate could not salvage?
>>
>>
>>*!*****************************************************************************
>>*!
>>*!       Function: SEEKCHILD
>>*!
>>*!      Called by: UNREGISTERED()     (function in VSO.PRG)
>>*!
>>*!*****************************************************************************
>>FUNCTION seekchild
>>	
>>	*@**************************************************************************
>>	*@ EXTERNAL FUNCTION => seekchild()
>>	*@
>>	*@ Seeks the Parent DBF's Children in Children DBF using the UNIQUEID connection.
>>	*@
>>	*@*** Parameters
>>	*@ String -> Parent DBF's Name
>>	*@ String -> Child DBF's Name in which to SEEK Parent's Current Record
>>	*@
>>	*@*** Return Value
>>	*@ Logical -> .T. - SEEK Successful
>>	*@            .F. - SEEK Failed
>>	*@
>>	*@**************************************************************************
>>	
>>	*** History
>>	***
>>	*** 18/10/97 Created
>>	*** 13/05/99 store the tag name into m._vsoerror for reporting
>>	
>>	PARAMETERS m.zparent, m.zchild
>>	
>>	PRIVATE ALL LIKE z*
>>	
>>	m.zsavselect = SELECT()
>>	
>>	SELECT (m.zchild)
>>	m.zsavorder = ORDER()
>>	
>>	m._vsoerror = "docid"
>>	SET ORDER TO TAG docid
>>	
>>*-*	= _gotop()
>>*-*	
>>*-*	LOCATE FOR &zchild..docid = &zparent..uniqueid
>>*-*	
>>*-*	IF FOUND()
>>
>>	IF SEEK(&zparent..uniqueid)
>>		m.zretval = .T.
>>	ELSE
>>		m.zretval = .F.
>>	ENDIF
>>	
>>	m._vsoerror = m.zsavorder
>>	SET ORDER TO TAG (m.zsavorder)
>>	
>>	SELECT (m.zsavselect)
>>	
>>	RETURN m.zretval
>>	
>>*!*****************************************************************************
>>*!
>>*!       Function: RELATEDCHILD
>>*!
>>*!      Called by: UNREGISTERED()     (function in VSO.PRG)
>>*!
>>*!*****************************************************************************
>>FUNCTION relatedchild
>>	
>>	*@**************************************************************************
>>	*@ EXTERNAL FUNCTION => relatedchild()
>>	*@
>>	*@ Return Logical values depending on the current record ID of the Parent
>>	*@ DBF's match with the current record ID of the Child DBF.
>>	*@
>>	*@*** Parameters
>>	*@ String -> Parent DBF's Name
>>	*@ String -> Child DBF's Name with which to compare the Parent's
>>	*@           Current ID Value
>>	*@
>>	*@*** Return Value
>>	*@ Logical -> .T. - Match Successful
>>	*@            .F. - Match Failed
>>	*@
>>	*@**************************************************************************
>>	
>>	*** History
>>	***
>>	*** 08/11/97 Created
>>	
>>	PARAMETERS m.zparent, m.zchild
>>	
>>	PRIVATE ALL LIKE z*
>>	
>>	RETURN &zchild..docid = &zparent..uniqueid
>>
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Previous
Reply
Map
View

Click here to load this message in the networking platform