Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Method names suggestion
Message
De
14/03/2013 10:28:31
 
 
À
14/03/2013 09:49:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01568344
Message ID:
01568363
Vues:
55
>SaveRecordPosition() and RestoreRecordPosition()


A common name in computers for these operations are push() and pop(). They come from assembly level instructions and something call the stack. You push something onto the stack, and you pop it back off (picture a stack of paper with sheets added).

In order to implement the push/pop, you need to not just have a single "save" and "restore" value, but rather to create an array, and continually increase the size as more data is pushed, and then always pop back off the most recent item. It would allow something like this:
loCursor.DoSelect()
* Sitting on RECNO() 15, let's say
loCursor.Push()
SCAN
    * Let's do something crazy, like iterate through the table a second time from the current RECNO()
    loCursor.Push()
    DO WHILE NOT EOF()
        * Something is done here
        loCursor.Skip()
    ENDDO
    * Right now RECNO() is at end of file
    loCursor.Pop()
    * Now, RECNO() Is restored to where it was as of the last outer SCAN iteration
ENDSCAN
loCursor.Pop()
* Now, RECNO() is restored to where it was after the DoSelect() above, record 15 let's say
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform