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)
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.
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)
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.