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

Generating SPR file for FORMS in VFP 6.0

Status
Not open for further replies.

kllick123

Technical User
Sep 24, 2002
22
IN
Hi,


If any one help me to generate a SPR file from the screen/form build from form designer as it was being generated in FOXPRO 2.6 for windows ?

Thanks


Arun Tayal
 

What verion of Visula FoxPro are you using? SPR files are no longer used in VFP.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 

Arun,

As Mike Gagnon says, SPR files are not used in Visual FoxPro. The only reason I can't think of for wanting to use them is if you are gradually upgrading an application from FoxPro 2.x or earlier. You might have a lot of calls to SPR files scattered around your code, but you are converting the actual screens to VFP forms.

If that's the case, all you have to do is to change the SPR files to contain a single line of code: DO FORM <whatever the screen was called>. Remember, SPR files are only text files, just like a PRG.

If you do that for each SPR after you create the VFP form, then your code should run OK until you get round to putting the DO FORM commands in code itslef.

Mike




__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Hi Mike & Mike

Thanks for the reply.

I am thinking of switching my .PRG (Foxpro 2.6 for windows) programs files to FORMS in VFP 6.0

But at one go I cann't change all the codes. Its very-very time consumming. For some of the codes I still have to depend on the .PRG files with few changes in the codeing.

For Example, I want to define a window in my program with scrollbars which can scroll the contents. But I am not able to get the syntax.

That is the reason why I was looking for the .SPR files.


Thanks

Arun Tayal
 

Arun,

OK, in that case I think my suggestion should work. Once you have converted the screen to a form, create the single-line SPR as per my suggestion. To run screens that you have not yet converted, just run the existing SPR. It should still work, although it will look a little strange in the visual environment.

By the way, when I said "DO FORM <whatever the screen was called>", that wasn't quite right. I should have said: DO whatever the screen was called.SPR. The point is that an SPR is just a PRG with a different extention.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
As I recall, VFP up to version 6 had a converter (referenced by _Transport ?) program that would open 2.6 SCXs; save it as a VFP6 SCX; and generate a new SPR file that would run the new form.

The SPR file contained almost what MikeLewis's First post suggested: a line saying Do Form <screenName>
That way, any existing PRGs that had the line "Do <screenName>.spr" would correctly open the form.

There is a slight additional complication: In 2.6 it was possible to have setup code in the form that could, for instance, declare variables visible across the whole form. VFP6 forms can't do that. So, the generated SPR would include that setup code at the top of the SPR.

Chris
 
Thanks to all of you.

Now I had decided to re-write/design the *.prg in the forms designer and learn the vfp.


Thanks

Arun
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top