Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reconciling Properties Concept to Fields Concept
Message
De
16/02/2006 03:24:36
 
 
À
15/02/2006 16:57:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01096402
Message ID:
01096670
Vues:
13
>Hi Fabio,
>
>Nice. What limitations has this method?
>
>I've tried a little example, which unfortunately does not work for me in VFP9:
>oForm = CreateObject('myForm')
>oForm.OverloadObject('atextbox','datetextbox','')
>oForm.Show(1)
>
>Define Class myForm as Form
>   Add Object atextbox as textbox
>
>   Procedure OverloadObject(cName,cClass,cClassLib)
>     form::Removeobject(m.cName)
>     form::Newobject(m.cName,m.cClass,evl(m.cClassLib,''))
>   EndProc
>EndDefine
>
>Define Class datetextbox as textbox
>   Format = 'D'
>EndDefine
>
>I get the error "Objectname is invalid" at the line form::Newobject. What did I misunderstood?
>
>Bye, Olaf.

Hi Olaf,

sorry, too many bugs, my brain is overloaded and I have forgotten this bug :)
clear
oForm = CreateObject('myForm')
oForm.OverloadObject('atextbox',"editbox",'')

Define Class myForm as Form
   Add Object atextbox as textbox

   Procedure OverloadObject(cName,cClass,cClassLib)
     form::Removeobject(m.cName)
     * none members
     ? "COMPONENTS :",m.this.controlcount,AMEMBERS(ao,m.this,2)
     * bug     
     ? m.cName," IS ",GETPEM(m.this,m.cName)
     WITH GETPEM(m.this,m.cName) && this is a Zombi object
         .baseclass
     ENDWITH
     form::Newobject(m.cName,m.cClass,m.cClassLib)

     ? "is cName a empty object ?", ADDPROPERTY(GETPEM(m.this,m.cName),"baseclass","empty")
     ? "don't believe in what I tell you, because if you verify it"
     WITH GETPEM(m.this,m.cName)
         .baseclass
     ENDWITH  
     ? "have proerties ? count it :",AMEMBERS(ao,GETPEM(m.this,m.cName))   
   ENDPROC
   
   PROCEDURE Error
   LPARAMETERS nError, cMethod, nLine
   ? " line : ",MESSAGE(1)," Error : ",MESSAGE()
   
ENDDEFINE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform