Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Curious problem with _TALLY after an SQL Select
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01043776
Message ID:
01043889
Vues:
14
Sergey;

I have been accused of over commenting my code. Luckily, I have not been bitten by this and learned a good lesson! I estimate I have at least a thousand VFP methods I have created using _TALLY after a select statement. I guess I am lucky! :)

Tom



>Hi Terry,
>
>Are you sure that code that fails is exactly the same? Maybe it looks more like following?
...
>  into Cursor csrNewRESUs NOFILTER
>* Comment ;
>lnRecCount  = _TALLY
>If lnRecCount > 0
>...
>
>>Curious problem I've never come across before. Consider the code below (an example as a very similar error occured in a similar piece):
>>
>>
>>Select *, RTE_NO + GEN + DIRECTN + STR( ESU_ID, 11) ;
>>  from mclMPSer!ROUTE_ESU ;
>>  where RTE_NO + GEN + DIRECTN + STR( ESU_ID, 11) not in ;
>>    (  Select Rte_No + Gen + Directn + STR( ESU_ID, 11) ;
>>  	from RouteESUMap) ;
>>  into Cursor csrNewRESUs NOFILTER
>>
>>lnRecCount  = _TALLY
>>If lnRecCount > 0					&& then new ROUTE_ESUs to copy over
>>    Wait WINDOW "Updating GIS RouteESUMap table with new Route-ESUs from mPlan ..." NOWAIT NOCLEAR
>>    Select csrNewRESUs
>>    ...
>>
>>
>>When it gets to the line If lnRecCount > 0 it crashes with the old:
>>
>>"operator/operand type mismatch" error.
>>
>>So I halt it and inspect in debug. I find, of course, _TALLY is 0 or an integer (depending on which example), but lnRecCount is .F. How can this be when the previous line has equated lnRecCount with _Tally!!! ?
>>
>>Now the first time it happened, I thought it a strange anomoly, and I equated the 2 values in the command window. Then I let the form run on, and the code below it worked OK, but it did exactly the same at the above code.
>>
>>'ppreciate it
>>
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform