Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hacking the SCX
Message
De
26/11/2001 10:53:37
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00585571
Message ID:
00585748
Vues:
29
>Jim,
>Thanks for your interest.
>
>I am in the process of converting 2.6 screens to VFP forms.
>In the course of doing this,I need to hack the VCX for a number of reasons:
>
>Example 1:
>In my 2.6 apps, I opened ALL files at the start of the APP and kept them open for the duration. I never had anything in the DE.
>
>I now want to use Private Data Sessions so one of the things I am doing is programatically populating each form with the relevent Cursors into the DE. This then allows me to use Private Data Sessions.
>
>I have considered rewriting the whole APP , but after long and careful consideration, have decided that Conversion and global modifcation will work. This will protect our exiting investment as well as allow us to develop further mods in VFP.
>
>Having said this, I am certainly open to better ways of doing things !!

Take a look at Alejandro Sosa's converter here in downloads. I don't remember whether he included my solution or developed some of his own, but basically you don't have to hack the .scx, you can build the DE on the fly (i.e. from a builder or converter) and then save the .scx with the DE object. Metacode would go like this:
oDE=createobject("dataenvironment")
oDe.AddObject("cursor1","cursor")
oDe.Cursor1.CursorSource=dbf("alias of your first table")
...
oDe.AddObject("Relation1","relation")
oDe.Relation1. (set properties here)
oForm.SaveAs(cNewScxFilename, oDe)
oForm object is what you have built converting or instantiated and got a references using ASelObj() function, i.e. an instance of your form in editor. Again, check Alejandro's converter, it should be doing all this already.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform