Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding custom properties at run time.
Message
De
10/08/1998 09:48:30
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
10/08/1998 09:37:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00125221
Message ID:
00125225
Vues:
19
>I'm a newbie...
>
>Is it possible to add custom properties programmatically at run time, as they will be extracted from a table that is maintainable.
>
>i.e.
>DEFINE CLASS myclass of CUSTOM
> CustomProperty1 = .F.
> CustomProperty2 = .F.
>ENDDEFINE
>
>I have tried setting the properties as strings and using macro substitution but this seems to have no effect.
>
>i.e.
>m.lcString = 'CustomProperty1 = .F.'
>DEFINE CLASS myclass of CUSTOM
> &lcString
>ENDDEFINE
>
>I would be greatful for any help.
To keep things simple at the start, just define one array property. ie:
define class myclass
  aMyRunTimePrps[1,1]
...
enddefine
At run time dimension your array to hold new elem and assign one column new prop name, value to second column.
In fact since props are coming from table you might even not need to define new props.
For adding props at runtime also there is addprop.fll in files section.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform