Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Private DataSession
Message
From
13/07/2006 16:31:05
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
13/07/2006 15:07:24
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01136031
Message ID:
01136226
Views:
9
>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
Ç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
Next
Reply
Map
View

Click here to load this message in the networking platform