Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding a value
Message
De
01/05/2010 08:55:49
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
01/05/2010 04:08:05
Chandan Chakraborty
Bangiya Gramin Vikash Bank
Raiganj, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
01462456
Message ID:
01462631
Vues:
88
This message has been marked as a message which has helped to the initial question of the thread.
You don't need to index every time you want to seek. At least, not in a table; the indexes are permanent in that case. (With a view, you have to create the index every time you create the view.)

Typical commands for searching would be like this:
use MyTable
* or, if it is already open:
select MyTable

set order to abc && replace abc with the name of the index tag
seek m.SearchValue && Whatever your variable is called, or some expression
if found()
  ...
endif
Specifying the ORDER when you open the file, as you showed, is also correct (use ... order ...)

However, doing a SEEK or SEEK() before specifying the index will give you the error "Table has no index order set". Without an index, you can still do a search without an index, with the LOCATE command. The result is usually slower, but you can search on any condition.

>Naomi
>
>I have tried it but am getting an error message," Table has no index order set". I have used the line
>
>
>Index on bcode to mcode
>
>
>I have also tried by this
>
>
>Use bcode order mcode
>
>
>But when I am using the following command in the style of old foxdos, every thing is perfect.
> ...
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform