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:15:53
 
 
À
31/12/2004 11:06:13
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:
00973543
Vues:
21
This message has been marked as the solution to the initial question of the thread.
Hi, Glenn

You're not wrong minded. The only problem is that SEEK() expects just the stem, not the full file name of the idx file. IOW, SEEK(3,'test','file.idx')fails.

Your code should look like this:
If Not Seek(3,'test',JustStem(cIDXIndexFileName))
	Messagebox('Not found')
Else
	Message('Found')
Endif
Hope this helps.

>The following code does not work (much like most of my other code) but I cannot understand why! Is the SEEK() function documented wrong or am I wrong minded? Someone please check this out.
>
>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',cIDXIndexFileName)
>	Messagebox('Not found')
>Else
>	Message('Found')
>Endif
>
>If Not Seek(3,'test',&cIDXIndexFileName)
>	Messagebox('Not found')
>Else
>	Message('Found')
>Endif
>
>If Not Seek(3,'test',(cIDXIndexFileName))
>	Messagebox('Not found')
>Else
>	Message('Found')
>Endif
>Close Tables All
>Erase test.Dbf
>Erase (cIDXIndexFileName)
>Dir *.idx
>
>
>
>Thanks
>
>Glenn
Grigore Dolghin
Class Software.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform