>Hi!
>
>Since it's my first post here, i want to say that my native language is French so excuse my poor english.
>I want to know if it's possible to create dynamically the properties of a custom object.
>
>Something like: (i know this won't work)
>DEFINE CLASS test AS CUSTOM
>
>FOR x = 1 TO lnNb
> PROTECTED &laVar(x)
>ENDFOR
>
>
>Thanks,
>
>Vincent
You can't use syntax like the above, because the only code that can run in a programmatic class definition has to be wrapped in a PROCEDURE with a name. You can do what you are trying to do though, with a visual class using the AddProperty method. Just get a reference to the design time object using ASELOBJ() or SYS(1270), and then run all the code you want from the command window or in a program, calling AddProperty.
PUBLIC o
o = SYS(1270) && Holding mouse over the object in the designer
FOR x = 1 TO lnNb
o.AddProperty(laVar + ALLTRIM(STR(x))
ENDFOR
AddProperty can only add public properties though...
Erik Moore
Clientelligence