Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Demystification of the SCAN
Message
 
À
07/03/2001 11:59:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00482753
Message ID:
00483309
Vues:
8
Paul,

I just finished a quick test and got some interesting results:

CREATE CURSOR test (f1 I, f2 C(1))
INSERT INTO test VALUES (1, "A")
INSERT INTO test VALUES (2, "B")
INSERT INTO test VALUES (3, "C")

SET DELE OFF
DELE ALL

SELECT * FROM test INTO CURSOR Set1
*** the result set has three records... all of which are deleted. _tally is 3.

SELECT * FROM test INTO CURSOR Set2 NOFILTER
*** the result set has three records... none of which are deleted. _tally is 3.

SET DELE ON
SELECT * FROM test INTO CURSOR Set3 NOFILTER
*** the result set has no records. _tally is 0

Regarding Set1:
With DELETE set off, all the records in cursor Test are visible;
VFP's SQL SELECT (when there are no GROUP BY, non-optimized WHERE or other similar conditions) is generating a set of pointers from cursor Test into cursor Set1. Cursor Set1 *IS* cursor Test.

Regarding Set2:
Again, with DELETE set off, all the records in cursor Test are visible;
In this case, the NOFILTER clause is forcing the generation of a new file.
VFP "sees" all the records in cursor Test and inserts them into cursor Set2.
This is analogous to:
CREATE CURSOR Set2 (f1 I, f2 C(10))
APPEND FROM DBF("Test")

Regarding Set3:
With DELETE set on, none of the records in cursor Test are visible;
Finding no records VFP creates cursor Set3, but has no records to insert.

Regards,
Thom Chichester
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform