Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using alias in lookup()
Message
De
15/11/2004 08:10:46
 
 
À
12/11/2004 09:22:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Divers
Thread ID:
00960793
Message ID:
00961355
Vues:
10
Hi Fabio,

So... it looks asif it acts upon two aliases because of the use of SET RELATION. One more reason to be cautious when encountering the function in someone else's code (or our own old code :), since it makes the function even more confusing and difficult to read.

>>Hi All,
>>
>>Here's some code someone else wrote.
>>
LOOKUP( EmpFcur.Both, M.EmpNo, EmpFcur.EmpNo, 'EMP' )
>>It looks up a value in the alias EmpFcur. It appears to work, even if EmpFcur is not the currently selected alias. I assume it is an undocumented, and very handy, feature.
>>
>>Any comments?
>
>You see the phrase "current selected work area" ? no
>
>LOOKUP has other property beneficial (or maleficent if they are not known!):
>
>CREATE CURSOR master ( aa i DEFAULT RECCOUNT())
>APPEND BLANK
>APPEND BLANK
>CREATE CURSOR child ( aa i,bb i)
>INSERT INTO child values (0,-1)
>INSERT INTO child VALUES (1,-2)
>INDEX ON aa TAG taa
>SET RELATION TO aa INTO child IN master
>? LOOKUP(child.bb,1,master.aa)
>? LOOKUP(child.bb,0,master.aa)
>CLOSE TABLES ALL
>
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform