Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indexing
Message
De
06/12/2014 07:57:09
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01610714
Message ID:
01611933
Vues:
80
>Sorry my mistake - obviously scan will not work - I was trying to bypass indexing issue - but in the current context there is no way to complete scan processing and exit. So back to seek(). If I open the database before hand and index then issue your command lines it works but I thought your intention was to eliminate the need for activating the index (order) and opening the database. At any rate I have found an easy way to access the information I need - I am just curious in future how I would get this to work.

No, the SEEK(item, alias, order) notation isn't to avoid opening the table. What it lets you do is write much more compact code. Without that notation, you have to write something like:
nOldWorkarea = SELECT()

SELECT MyAlias
cOldOrder = ORDER()
SET ORDER TO MyOrder

SEEK MyItem
IF FOUND()
   * Do something
ENDIF

SET ORDER TO &cOldOrder

SELECT (m.nOldWorkarea)
The SEEK() function handles all that in the background and leaves things as they were, except for moving the record pointer. It also means that no interrupt (like a timer) can interfere with your code since it's handled as a unit.

In general, I prefer to write code where I don't have to save old states, do the job and then restore the old state, so whenever I can, I use the IN clause or add the alias to a function call.

Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform