Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disappearing alias?
Message
De
17/01/2005 23:50:31
 
 
À
17/01/2005 23:37:25
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Divers
Thread ID:
00977939
Message ID:
00977951
Vues:
30
>>>Any guesses on how an alias can disappear?
>>>
>>>I have the following:
>>>
>>>      SELECT * FROM components INTO CURSOR MyComponents ;
>>>         WHERE KitID==lcPartNo
>>>      llIskit = 0<RECCOUNT("MyComponents")
>>>
>>>This is in a loop that is executed a few thousand times. On rare occasions, the second line fails with "alias not found" ... and when this occurs, ALIAS() is empty! That's right, I get a cursor with NO alias.
>>>
>>>Any guesses on how to get around this? (No, it's not as easy as doing RECCOUNT() -later on, having done various and sundry other things with other SELECT statements, I need to get back to this alias --)
>>>
>>>Thanks
>>
>>Hi James, The second line looks strange. Is it a typo? llIskit = 0<RECCOUNT("MyComponents")
>
>I would normally write it the other way: reccount(...) > 0; but apart from personal preference, I think it is perfectly valid.

Oh, I see it now. It returns a logical to llIskit. I agree I would write it the other way around and I would have enclosed the right-hand side in brackets. Each to their own style :)

Anyway, I would add code to (a) to close any cursor called "MyComponents" first before the SELECT (b) check for a cursor afer the SELECT and before the RECCOUNT() test as additional tests for trapping the problem.
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform