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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Going from FPW2.6 to VFP7

Status
Not open for further replies.

Ashr

Programmer
Apr 19, 2005
46
HU
I m doing this transfer unwillingly but I don't have a choice , right now my main problem is where to put my Procedures which where written in FPW2.6 under "Screen, Layout, Code, Cleanup & Procedures" .

Thank's
 
Depends on how fast you need it to work. If time is a big issue then simply convert the screens without going to the visual conversion.

Update with the oop stuff will take a bit of time but it will be worth the learning curve.

Don


 
Thank's crewchiefpro6 , I don't realy know VFP & it's look like completly differnt , I will try to learen it. right now I m looking to find out where can I write procedures to be used for all the form , I have a form screen & I don't know where can I write procedures to be called from any field in the form.

 
You need to add custom methods, then put each procedure in a single method. From the VFP menu, select Form > New Method to create the method, then double-click on the method name in the Properties dialog to bring up the editor. When you need to call the method from code, use
ThisForm.MyCustomMethod().

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Thank's craigber , I understand now , can I excute the metod by "do ThisForm.MyCustomMethod" or only by the way u described in your answer?
 
U will find a great help with the book 'THE FUNDAMENTALS: building visual studio Applications on a Visual foxpro 6.0 foundation' from Whil Hentzen. Absolutely a must for u, i think.

And to answer ur question:
U can never use 'do method' as u were used to 'do procedure'

U must learn now to use object programming:
a CLASS is a piece of program u can NOT use directly with for example 'do class'.
U must first CREATE an OBJECT of it, to make a class alive, with the command CREATEOBJECT or NEWOBJECT
Then u can call a method with 'object.method'

A form is already an OBJECT of an class, so u can use also 'form-NAME.method' or 'thisform.method' or 'this.method'


 
Thank's ronald777 , u gave me real help ,

u can use also 'form-NAME.method'or 'thisform.method' or 'this.method'
so this quote will excute the command(s) in that certain method without have to write DO ??????
 
It might work...it depends on what the code does. I agree with ronald777, you should get a copy of the Fundamentals from It will really help you understand how to do VFP. While you're there, check out the other VFP titles.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
if you call form methods, you don't call them with DO, yes. With DO you only call PRGs (Project Manager Tab "Code"). If you want your procedures/functions to be available from EVERY form etc. you store them in PRG and SET PROCEDURE TO ...prg, ...prg etc. in your main.prg

Bye, Olaf.
 
Hello. Maybe I can help

When you convert a form from fpw26 to Vfp7, VFP will create an .SPR file, where you have all your code (snippets) in it.

To run your form, type Do formsName.SPR and it will appear.

If you want to acess any control in the form, you have to press CTRL, and then click on the control.


BTW, the book "Fundamentals", is a must.

Bye

Nro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top