Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can not get it right
Message
De
03/02/2006 08:50:12
 
 
À
03/02/2006 06:30:41
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01092465
Message ID:
01093296
Vues:
23
>>>>>>>>lo=eval("m.toThis." + m.lcObjName)
>>>>>>>
>>>>>>>That's I believe what I tried. But may be I did put mismatched quotes... I'll re-try.
>>>>>>>
>>>>>>>UPDATE. Yes, it worked. I had a very bad headache the whole day yesterday at work, may be I just could not concentrate... My colleague told me he also had it and my son did, so I think it's weather related...
>>>>>>
>>>>>>use
>>>>>>
>>>>>>lo=GETPEM(m.toThis,m.lcObjName)
>>>>>>
>>>>>
>>>>>I thought about it too. But anyway, evaluate works and it seems good enough for me.
>>>>
>>>>It work ( slower ),
>>>>but it is formally wrong when the object reference is static
>>>>as in :
>>>>"m.toThis."
>>>
>>>Could you please elaborate more? Also GetPem doesn't have object reference as a return type, that's why I thought it would not work.
>>
>>??? why ???
>>If GETPEM didn't return an object reference, what it could return?
>>
>>>
>>>Thanks.
>>
>>I mean you this
>>
>>* this it is VFP static code and then it is faster
>>r1=GETPEM(m.toThis,m.lcObjName)
>>* this return the same value,
>>* but when someone uses unnecessary dynamic code, it do a mistake
>>r2=eval("m.toThis." + m.lcObjName)
>>? "this print true",r1=r2
>>
>
>So everything done before VFP 6 was a mistake? GETPEM was added in VFP6.

Not true.
Mistake was VFP3 and VFP5 because GETPEM() it had to be;
but to use EVAL() was correct because GETPEM() didn't exist.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform