>You don´t miss anything Cetin! I´d like to know a way to do this whithout any changes in my forms incluing the scx! When you create a new form, you create a new instance of the basic form, right? I´d like to do the same with the datasession, create a new datasession based on the default datasession. Create datasession as defaultdatasession. Something like that! Now, i can do what you sugest. I´ll open my scx and alter the BaseClass of my forms.
>
>Thanks a lot!
>
>Ricardo Pôssas
Ricardo,
BTW I didn't mean open them one-by-one to make the change. No lazy programmer would do that!
Create a class library and a form in it (say myBaseForm).
In pseudocode (not so pseudo - not exact):
lcDir = getdir()
for ix = 1 to adir(aForms,addbs(m.lcDir)+"*.scx")
use (addbs(m.lcDir)+aForms[m.ix,1])
replace class with "myBaseForm", classloc with < fullpath of your classlib > ;
for lower(class) == "form" and empty(classloc)
use
endfor
To make all of your forms in choosen directory (and no parent class) to inherit from your new form class. Then you can add code to that base as you want (you might need to add code to the above to also take care of already existing code - ie: if you do your "set" adjustment in load event of baseform and any existing form has code in load event then it would override).
Cetin