Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a Quick Way to...
Message
De
22/03/2002 16:35:55
 
 
À
22/03/2002 15:02:37
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00636233
Message ID:
00636288
Vues:
24
>I am faced with the prospect of inserting some code into the dataenvironment before open tables procedure for some 100 odd forms. Is there a quick way I can hack the SCX file to determine which forms use a data environment? Thanks!

You could do something using the Files collection of the Project object, plus builder-type code. I'm thinking of something along these lines (totally untested):

FOR EACH oFile IN _VFP.ActiveProject.Files
IF oFile.Type = "K" && Form
MODIFY FORM (oFile.Name) NOWAIT
MOUSE CLICK AT 1,1 WINDOW (oFile.Name) && This probably needs some adjusting
ASELOBJ(aDE,2)
* Now aDE[1] contains an object reference to the DE
nDEMembers = AMEMBERS( aDE[1], 2)
IF nDEMembers > 0
* There's something in the DE
aDE[1].WriteMethod("BeforeOpenTables",cTheNewCode)
ENDIF
KEYBOARD "{CTRL-F4}Y" && set up close of FD
ACTIVATE WINDOW (oFile.Name) && this'll probably need fixing
ENDIF
ENDFOR

The pieces I'm unsure about are getting a handle on something on the form, and creating the wait state to close the form. The rest should work more or less as written.

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform