Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add methods to a class based on field values
Message
De
06/01/2005 11:14:50
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Add methods to a class based on field values
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00974698
Message ID:
00974698
Vues:
51
I have a class that I created named sysinfo of atisysinfo.vcx based on the container class.

I have a table named sysinfobld that contains these fields:

csubitem c(50)
mmethod M

csubitem contains a character value such as config file, ip address, login, etc. Mmethod contains the procedure code that returns a value. The return value is always a character expression. I step through the table and for each value in csubitem I issue:

m.newvalue = EXECSCRIPT(mmethod)

Then I store m.newvalue in a memo field of another table which is displayed in a treeview.

Instead of using a table, I want to create methods in my class where the method name is the value in csubitem and the code is from mmethod. I would like to programmatically step through the table (in development) to modify the class something like:
oSysInfo = NEWOBJECT('SysInfo', 'ATISysInfo.vcx')
SELE sysinfobld
SCAN
   IF !PEMSTATUS(osysinfo,sysinfobld.csubitem,5)
      ADDPROPERTY(osysinfo,sysinfobld.csubitem,'')
   ENDIF
   *--Now store the value in the memo field mmethod to the class method
   *--?
ENDSCAN
Then in the runtime, I can call the methods in the class instead of executing the code in the memo field and the table will no longer be used. The table was used for gathering the functions in one place during research/testing. However, what is the correct syntax to do this? can it be done?
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform