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

Program Header

Status
Not open for further replies.

JPGalea

Programmer
Apr 19, 2009
20
0
0
US
Hi,
How do I get these fields filled in with my data?

* * Author's Name
* *
* * Copyright (c) 2017 Company Name
* * Address
* * City, Zip
* *
* * Description:
* * This program was automatically generated by GENSCRN.

Thanks,
Joe
 
JPGalea said:
How do I get these fields filled in with my data?

Those fields WHERE?
* On a User Input Form?
* In a Data Table?

And where is the data coming from?
* A FP/VFP Data Table?
* Somewhere else?

Plus:
This program was automatically generated by GENSCRN

We STRONGLY suggest that you not use a Wizard to create forms.
Instead learn to build Forms/Screens as 'raw' so that you can learn how they work and what needs to be done where/when within the Form/Screen.

Due to the language-specific forum area you have posted this question into, we can only guess that you are using an OLD version of Foxpro.

If you should happen to be using one of the more modern versions of VISUAL FOXPRO, you should probably spend some time looking over the Free, Online VFP Tutorial Videos at:
Link

Good Luck,
JRB-Bldr

 
Sorry For any confusion. This is FPV2.6 output from Program Generate after a screen is defined. It creates screen_name.SPR Which is then compiled into .SPX.
The generated code has the header that I copied into this post. I was asking how would I pass my information so that it would be in the generated code. So Company Name would become Acme Corporation and Address would become 1000 Circle Dr., etc..
 
Never mind, I found it.
There is a "Comment Options" button on the Generate Screen/Menu window.

 
Admittedly it has been a LONG time since I used FP2.6W, but I do remember that the Screens had code 'Snippets' where you write the code to make the screen work the way you want it to.

JPGalea said:
I was asking how would I pass my information so that it would be in the generated code.

You could either 'Hard Code' in the values that you wanted to write to the Screen's textboxes (not the recommended approach).

Or you could put the separate values into their appropriate fields in a FP Data Table and then have the Screen USE the data table and 'read' the values out - putting them into the Screen's textbox fields.

Since you seem to be new to all of this I'd recommend that you get into VISUAL Foxpro where things work a little differently, but it is the most current. VFP9 is the latest version that most of us are using.

Good Luck,
JRB-Bldr

 
Note that those values, used by genscrn.prg, are stored in the project.

If you do all your work through the project manager (which you SHOULD be doing), you only have to enter them once.
 
Building on what Dan has said: When you have your project opened (assuming you are using the project manager - which like Dan said... YOU SHOULD), on the menu click PROJECT-->OPTIONS

The screen that appears is where you can enter the information you are talking about.
This info will then be applied to the entire project, not just one screen.

Hope that helps.
 
I would like to discuss the recommendation of using Project Manager. I am willing to do it right, but not at the cost of complicating and slowing my response to my client.
I have tried to use PM and found limitations. For instance my screens/menu and report forms are in their own folders as are my tables and programs. I also get numerous errors where it thinks arrays are programs and can't find them.
I am the creator and sole support of one custom app for my son's business. If there needs to be any changes I simply copy the modified Foxprow elements to the production environment. I have been doing this off and on since 1991 and have provided support without the formality of PM. It seemed to me that it would be a lot more work for me and slower response to my one 'client'.
 
You do realize that "copying FPW elements" to your client machines is illegal unless they've purchased full FPW licenses, right?

The PM allows you to build executable files that you CAN freely distribute (with appropriate runtime support files). The PM does not care about files in multiple directories. You can resolve array references with the EXTERNAL keyword (see the help file), but those are just compile-time warnings anyway.

The project manager is the most important tool for developing applications for (legal) distribution.
 
To the contrary, using the project manager makes things a lot easier and quicker - regardless of the situation. The various components being located in different folders is not an issue - in fact I use folders to organize components as well. When you create a project you need to add every component to the list - if you leave any out than issues can arise.

In regards to it thinking that arrays are programs/functions, you would need to post some of the code. The only time it should do that is if the array isn't predefined before the reference that is erroring-out - this could be caused by a snipet being ran that contains the array before the snipet that initializes it.

If you don't have this already, I would suggest creating a master PRG, which will be the first code that is executed. In that code you will initialize all the variables you are using globally for your project. Then when you create the project, this master PRG will be the FIRST item you add - making it the first item to run. You will see that a little black dot will be to the right of it - which indicates its the first code to be executed.

The beauty of the project manager is that you only have to click "compile" once no matter how much code, and how many files, are modified. I assume from your current setup, if you modify 5 screen files that you have to go and generate and compile each one individually. Also the project manager is the only way to make APPs and standalone EXEs.

So it may that a few minutes to get acquainted with the project manager - but it will make your life so much easier.... its a shame you have been coding in FPW26 for 25 years without using it.
 
The solution to the array issue is to add:

Code:
EXTERNAL ARRAY YourArrayName

in any routine that references an array that's declared elsewhere.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top