Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
To Seek or not to Seek that is the question
Message
De
31/12/2004 11:58:27
 
 
À
31/12/2004 11:49:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00973540
Message ID:
00973555
Vues:
18
Absolutely correct! I am embarassed. I used the Juststem() function in the WRONG place. This works exactly as stated.

Thanks

Glenn

>Hi, Glen
>
>I'm sorry for delay, I didn't see your reply to Alan. JustStem does work. I think you expect to see a messagebox saying "Found", but this doesn't happen because the code says Message("Found"), not MessageBox('Found').
>
>The code below works as expected:
>
>
>Close Tables All
>Local i, cIDXIndexFileName
>Create Table test (iKey i)
>For i = 1 To 20
>	Insert Into test Values (i)
>Endfor
>Clear
>cIDXIndexFileName = Forceext(Substr(Sys(2015),2,8),'idx')
>? cIDXIndexFileName
>Index On iKey To (cIDXIndexFileName)
>
>#if .f.
>
>SEEK(eExpression [, nWorkArea | cTableAlias
>   [, nIndexNumber | cIDXIndexFileName | cTagName]])
>
>#endif
>
>
>If Not Seek(3,'test',JUSTSTEM(cIDXIndexFileName))
>	Messagebox('Not found')
>Else
>	MessageBox('Found')
>Endif
>
>Close Tables All
>Erase test.Dbf
>Erase (cIDXIndexFileName)
>Dir *.idx
>
>
>Hope this helps.
>
>Grig.
>
>
>>No cigar! I specified juststem(...) and still the problem. I am afraid the problem may be in the documentation or VFP engine (oh no!)
>>
>>Thanks
>>
>>Glenn
>>
>>
>>>Hi Glenn.
>>>
>>>I think the problem is with cIDXIndexFileName. The SEEK already assumes this is an IDX, so the file name extension needs to be removed. Change your prg to
>>>
>>>cIDXIndexFileName = Substr(Sys(2015),2,8)
>>>
>>>and first SEEK in your code then works.
>>>
>>>Alan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform