Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: James Doherty
  Where is James Doherty?
 Dublin
 Ireland
 James Doherty
 To: Yuri Rubinov
  Where is Yuri Rubinov?
 Philadelphia
 Pennsylvania - United States
 Yuri Rubinov
 Tags
Subject: RE: SEEK() appears to hang
Thread ID: 228683 Message ID: 228692 # Views: 1 # Ratings: 0
Version: Visual FoxPro 8 Category: Errors & Debugging
Date: Wednesday, May 20, 2009 8:42:46 PM         
   


Hi Yuri,

Thanks for getting back so quickly. I think it's the SEEK() in the GetShortVersion() function because I have stepped through the code and have seen it work through the SCAN until it appears to "hang" on a record despite having worked for the previous record with the same value!

Thanks once again, J

>
> > 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
> >
>
> Good Start.
> Now could you tell why do you think that the problem is with SEEK, but not with "Do something..." as in your code? Do you have any friendly messages included into your code that show what your program is doing at the moment?
>
> Yuri Rubinov

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