Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using NOFILTER
Message
De
01/05/2001 12:06:18
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Using NOFILTER
Divers
Thread ID:
00502009
Message ID:
00502009
Vues:
61
Here's one which took me 2 hours to find the reason. I had a SQL which was doing something like this:
SELECT CREATION FROM POINT;
 WHERE CREATION>=ldDate AND CREATION <=ldDate2 ORDER BY 1 DESCENDING INTO CURSOR TEMP
Then, when I found there was a problem, I started to display some status. So, I had something like this:
SELECT CREATION FROM POINT;
 WHERE CREATION>=ldDate AND CREATION <=ldDate2 ORDER BY 1 DESCENDING INTO CURSOR TEMP
MyFunction()

FUNCTION MyFunction
Statut(ALIAS()+' '+IIF(EOF(),'EOF','NOT EOF()'))
SKIP
Statut(ALIAS()+' '+IIF(EOF(),'EOF','NOT EOF()'))
SKIP
At that time, since there was a problem, the first display was showing NOT EOF and the second one, EOF. However, the _TALLY was showing 20 records. So, I knew I was not suppose to be at EOF().

So, I decide to add some status lines before the call to the function.
SELECT CREATION FROM POINT;
 WHERE CREATION>=ldDate AND CREATION <=ldDate2 ORDER BY 1 DESCENDING INTO CURSOR TEMP
Statut(ALIAS()+' '+IIF(EOF(),'EOF','NOT EOF()'))
SKIP
Statut(ALIAS()+' '+IIF(EOF(),'EOF','NOT EOF()'))
SKIP
GO TOP
MyFunction()

FUNCTION MyFunction
Statut(ALIAS()+' '+IIF(EOF(),'EOF','NOT EOF()'))
SKIP
Statut(ALIAS()+' '+IIF(EOF(),'EOF','NOT EOF()'))
SKIP
So, the result was now giving, NOT EOF, NOT EOF, NOT EOF and EOF.

So, the only think I could see what that I was inside a function. So, I decided to move the status lines all in the same place:
SELECT CREATION FROM POINT;
 WHERE CREATION>=ldDate AND CREATION <=ldDate2 ORDER BY 1 DESCENDING INTO CURSOR TEMP
Statut(ALIAS()+' '+IIF(EOF(),'EOF','NOT EOF()'))
SKIP
Statut(ALIAS()+' '+IIF(EOF(),'EOF','NOT EOF()'))
SKIP
GO TOP
Statut(ALIAS()+' '+IIF(EOF(),'EOF','NOT EOF()'))
SKIP
Statut(ALIAS()+' '+IIF(EOF(),'EOF','NOT EOF()'))
SKIP
That then gave me NOT EOF, NOT EOF, NOT EOF and NOT EOF. Which is what is good.

So, I came up with:
SELECT CREATION FROM POINT;
 WHERE CREATION>=ldDate AND CREATION <=ldDate2 ORDER BY 1 DESCENDING NOFILTER INTO CURSOR TEMP
By adding a NOFILTER, all is ok when I proceed in another function.

Why is it like that?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform