Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding Property with Property_Assign to all classes
Message
De
31/08/2000 12:23:38
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00411336
Message ID:
00411358
Vues:
20
>>>>Correction:
>>>>Tray Walpole. Sorry for misspelling your last name, Tray
>>>>
>>>>>Hi everyone,
>>>>>
>>>>>Using Trey Weapole
>>>
>>>Now you got the first name wrong :)
>>>
>>>Quick way: hack your base class .VCX file.
>>>BE VERY CAREFUL DOING THIS - BACK UP FIRST TO BE SAFE
>>>
>>>USE mybase.vcx
>>>REPLACE reserved3 WITH ALLTRIM(reserved3)+"lenabled Description of lenabled" ;
>>>ššFOR ALLTRIM(reserved1) == "Class"
>>>USE
>>>COMPILE CLASS mybase.vcx

>>
>>
>>Trey,
>>
>> This would add description of the new property to all classes, right? What about adding property and associated assign method?
>>
>> I'm going to try your idea right now.
>
>Great, it works!

Cool!

To add the lenabled_assign method do the same thing, except with a "*" in front of the method name. That tells VFP it's a method (and array properties start with "^", BTW)

REPLACE reserved3 WITH ALLTRIM(reserved3)+"*lenabled_assign lenabled Assign method" ;
  FOR ALLTRIM(reserved1) == "Class"


and add the procedure to the methods field
This is the default setting that appears.

REPLACE methods WITH allt(methods)+ ;
  "PROCEDURE lenabled_assign"+CHR(13)+CHR(10)+ ;
  "LPARAMETERS vNewVal"+CHR(13)+CHR(10)+ ;
  "*To do: Modify this routine for the Assign method"+CHR(13)+CHR(10)+ ;
  "THIS.LENABLED = m.vNewVal"+CHR(13)+CHR(10)+"ENDPROC" ;
  for reserved1="Class"
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform