Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I view code behind a form 7

Status
Not open for further replies.

stable

Programmer
Mar 19, 2003
92
NZ
Hi there,

I've not used FoxPro before. I've inherited an application originally developed in an old version of FoxPro and converted into Visual FoxPro.

When I open the project in VFP I can see the forms but there is no code "behind" the form - more to the point I don't know how to look at the code. My background is in using MS Access and I expected to see something like the Properties box and an events tab where there is the facility to enter an event procedure for an event.

To view the form in the Project manager window I select the form and click the modify button. The form displayed looks more like an image i.e. I can't click on any controls to get the focus. It is possible to add new controls to the form and seemingly a procedure can also be added for an event.

When the application runs I know that there are comboboxes that are updated depending on user selection so there definitely is some logic behind the form.

Any hints would be much appreciated!

Cheers
 
Hello Stable

Maybe I can help. I understand that your apps was in an old version of Foxpro (2.6 or less) and converted into VFP 8.0

If you convert the project, all the screens will be converted as forms in VFP.

Now, I also understand that you are experienced with ACCESS. A screen in ACCESS is consider as a container by itself. If you click on one control, you can access all the PEM's. In VFP, your converted screen is now what we call a Formset, wich contain pages. You can't access objects directly from your screen (that's probably the reason it looks like and Image). You have to left click on the pageFrame, then right click to open a popup, and choose Edit. Then you'll be able to access all of the PEM's of the form controls (you can also press CTRL and click on the control to access it)

Now for the code. Depending how the apps was converted, for each forms, VFP will create a file with .SPR extention, where you can find all the code from the original form (snippets ?). If you look in the Code tab of your project, it should be there. (for exemple, if I have a form called frmCust.SCX, there will be a frmCust.SPR, with all the code in it)

I hope it will help you

Nro

 
Hi Nro,

Success!!
I'm able to select the controls on the form and by double clicking on the command control buttons I can see the code for this event.
When I try to open the .spr file I get
File access is denied (Error 1705). This is not a major as most of the logic I'm interested in is behind the command buttons.

Looking back I think Toman was giving me similar instructions but I must have done something wrong that time.

A star for you! Thanks very much for your help.

Cheers
Stable
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top