Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Private DataSession
Message
De
13/07/2006 16:31:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
13/07/2006 15:07:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01136031
Message ID:
01136226
Vues:
10
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform