Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Network:
Windows Server 2012
Virtual environment:
VMWare
That worked. I also tried GETPEM() and it works. Not sure if one or the other is faster (both should be faster than at least macro substitution).
Now if I could just add something to the VFP help file for the next time I need this...
Thanks all!
>>Hi all,
>>
>>I wanted to write some generic code that would continue to work even if I added objects to a screen at runtime.
>>
>>Is there another way to get an object reference to a screen object when part of the name is in a var?
>>
>>I know I can use PEMSTATUS() to test if the object exists. Say that below was in a loop to test for a dozen objects
>>
>>lnLoop = 5
>>
>>lcObjectName = "label" + LTRIM(STR(lnLoop))
>>
>>IF PEMSTATUS(THISFORM,lcObjectName,5)
>>
>> loLabel = THISFORM.&lcObjectName
>>
>>ENDIF
>>
>>Is there any other way to get a reference to the object other than macro expansion? I think I figured this out once but dang if I can find it.
>>
>>Thanks,
>>Albert
>
>loLabel = evaluate('thisform.' + lcObjectName)
>
>Looks also at GetPem() function. I think it can be used too, but I am not too familiar with that.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement