Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question Abt. Data Environment
Message
De
25/12/1997 07:03:29
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordanie
 
 
À
23/12/1997 10:48:23
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00067659
Message ID:
00067919
Vues:
27
>>
>>Thanks for your reply !!! Your suggestion is very useful...
>>
>>But I'm facing few problems in setting it up...
>>
>>If I just set the path to my season dir.. it opens file from the dir. where I'm developing the application...
>>
>>I guess this is because the thisform.dataenvironment.cursor1.database value is set to my application development dir...
>>
>>Now what I'm doing is Opening the form with Autoopentables=.f.
>>
>>In the load method of form, I'm setting the value of
>>
>>thisform.dataenvironment.cursor1.database=myseasondir
>>
>>& then running Opentables...
>>
>>Pls tell me :-
>>
>>1. Am I doing it right way or is there any shortcut..
>>2. If my method is right, Is there any generic routine which can loop through all the cursors and set the value...
>>3. How I should handle Tables which are common that means dbfs which are having common value for the software.. like setup.dbf..
>>
>>Pls help...
>Hi,
>This is a simple example for a generic form loader in your case. I think this is simplier to apply.
>To apply it easily you could write this small prg and run it during form design.
>**
>* Form design mode - to change code in beforeopentables in DE
>*
>#define nl chr(13)
>cPathChanger = "cNewDataPath = _screen.comment"+nl+ ;
> ... && See below
>=aselobj(myArray,2) && Get a reference to DE
>myArray[1].writemethod("BeforeOpenTables",cPathChanger)
>
>
>* Dataenvironment.beforeopentables
>cNewDataPath = _screen.comment && or wherever stored
>set path to (cNewDataPath)
>nDataObjects = amembers(aMyArray,this,2)
>cOldPath = this.&aMyArray[1]..database
>cNewDbPath = cNewDataPath+substr(cOldPath,rat("\",cOldPath))
>for ix = 1 to nDataObjects
> if this.&aMyArray[ix]..baseclass = "Cursor"
> this.&aMyArray[ix]..database = cNewDbPath
> endif
>endfor
>
>Here is a way to change path at runtime using above :
>
>*Method processing user data path && Likely to be called instead of do form
>lparameters cNewDataPath, fForm
>_screen.comment=cNewDataPath && Instead of pub var - if !used to store something else like form instances
>do form (fForm)
>Cetin


Thanks a Lot !! Your suggestion is very good and its working fine..

But it took me some time to understand it completely !!

I'm using ur code with some modifications but Still One thing I wanted to ask you:-

what this piece of code will do :-

>* Form design mode - to change code in beforeopentables in DE
>*
>#define nl chr(13)
>cPathChanger = "cNewDataPath = _screen.comment"+nl+ ;
> ... && See below
>=aselobj(myArray,2) && Get a reference to DE
>myArray[1].writemethod("BeforeOpenTables",cPathChanger)
>

Can u pls Explain me..
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform