Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reading class properties without instantiating a class
Message
De
29/09/2006 17:29:12
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01158181
Message ID:
01158297
Vues:
32
This message has been marked as a message which has helped to the initial question of the thread.
>>>>
>>>>WITH NEWOBJECT("CLASS","CLASSFILE_VCX_PRG",0)
>>>>   for p=1 to AMEMBERS(apnames,this)
>>>>     pvalue=getpem(.class,ap[p])
>>>>     * writeexpression/addproperty
>>>>   next
>>>>   * other
>>>>ENDWITH
>>>>
>>>
>>>Also what can we do if we don't want to supply the second parameter? All our class libraries and programs are in memory and we never specify classlibrary when instantiating a class.
>>
>>Naomi,
>>What do you want to do on the class?
>>I have not understood if you want to read it to modify or other.
>
>The class has some properties cFldNames, cCaption set in design-time. I'd like to get values of these properties. I do not know where the class definition is stored and I'd like to get these properties without instantiating a class, because the Init of the class has some references to thisform and I may not have a form...

Then you cannot read the vcx/prg.

VFP have not a
=LOADCLASS('classname','classfile')
well, it needs to force the loading:
TRY
  =NEWOBJECT("classname")
CATCH
FINALLY
   ? getpem("classname","cFldNames"
   ? getpem("classname","cCaption"
   CLEAR CLASS "classname"
ENDTRY
Of course, the code in Init have to not change the application's state.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform