Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 To: James Doherty
  Where is James Doherty?
 Dublin
 Ireland
 James Doherty
 Tags
Subject: RE: SEEK() appears to hang
Thread ID: 228683 Message ID: 228689 # Views: 1 # Ratings: 0
Version: Visual FoxPro 8 Category: Errors & Debugging
Date: Wednesday, May 20, 2009 8:18:27 PM         
   


> Hi there,
>
> Here is the code approx, don't have the exact code to hand at the minute:
>
> SET NEAR ON
> SET EXACT ON
>
> SELECT addresstable1
> lcValue = GetShortVersion(address1)
>
> SELECT addresstable2
> SET ORDER TO address1
> IF SEEK(lcValue)
> SCAN WHILE GetShortVersion(address1) = lcValue
> Do something...
> ENDSCAN
> ENDIF
>
> FUNCTION GetShortVersion
> LPARAMETERS tcExpression
> LOCAL lnCount, lcString, lcReturn
>
> STORE "" TO lcString, lcReturn
> lnCount = 0
>
> IF EMPTY(tcExpression)
> RETURN lcReturn
> ENDIF
>
> tcExpression = ALLTRIM(UPPER(tcExpression))
>
>
> FOR lnCount = 1 TO GETWORDCOUNT(tcExpression)
> lcString = GETWORDNUM(tcExpression, lnCount)
> IF SEEK(lcString, "ShortTable", "longform")
> lcReturn = lcReturn + " " + shortform
> ELSE
> lcReturn = lcReturn + " " + lcString
> ENDIF
> ENDFOR
>
> RETURN ALLTRIM(lcReturn)
> ENDFUNC
>
> Hope this makes some sense!
>
> Thanks again, J
>
> >
> > Show your code, please.
> >
> > Yuri Rubinov

Your index seems to be on ADDRESS1 and the SCAN seems to be on GETSHORTVERSION(ADDRESS1).

You could also do something like

SCAN WHILE GetShortVersion(address1) = lcValue
   lnRec=RECNO()
   Do something...
   SELECT addresstable2
   GO lnRec
ENDSCAN


and check if that hangs.

Regards
Tushar

ENTIRE THREAD

SEEK() appears to hang Posted by James Doherty @ 5/20/2009 7:43:49 PM
RE: SEEK() appears to hang Posted by Yuri Rubinov @ 5/20/2009 7:45:39 PM
RE: SEEK() appears to hang Posted by James Doherty @ 5/20/2009 7:59:49 PM
RE: SEEK() appears to hang Posted by Yuri Rubinov @ 5/20/2009 8:06:11 PM
RE: SEEK() appears to hang Posted by James Doherty @ 5/20/2009 8:42:46 PM
RE: SEEK() appears to hang Posted by tushar @ 5/20/2009 8:18:27 PM
RE: SEEK() appears to hang Posted by Yuri Rubinov @ 5/21/2009 3:58:44 PM
RE: SEEK() appears to hang Posted by James Doherty @ 5/21/2009 4:31:59 PM
RE: SEEK() appears to hang Posted by Tamar Granor @ 5/21/2009 10:26:38 PM
RE: SEEK() appears to hang Posted by James Doherty @ 5/22/2009 10:10:10 AM