Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using NOFILTER
Message
 
 
À
01/05/2001 12:06:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Divers
Thread ID:
00502009
Message ID:
00502037
Vues:
16
Michel,

W/o NOFILTER foxpro wasn't creating cursor on the disk. Instead it opened source table again with alias temp an issued a series command to get requred result.
USE Point Again ALIAS Temp
SET FILTER TO
CREATION>=ldDate AND CREATION <=ldDate2
SET ORDER TO CREATION DESCENDING
?DBF("temp") would show the name of source table.

Using NOFILTER forces foxpro to create cursor on the disk.

>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?
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform