Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding custom properties at run time.
Message
From
10/08/1998 09:48:30
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
10/08/1998 09:37:35
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00125221
Message ID:
00125225
Views:
18
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform