-
1
- #1
I have made my own program generator in Foxpro 2.6 for Dos. First of all you have to make your programs structured.<br>
Then you'll find that only certain things change for a similar program.e.g. You have a Maintenance program for City Master file ( Fields : CityCode, Cityname). In your program you - add, modify,delete, view ,find - a city. Now consider a Country Master File ( fields : CtryCode,CtryName ). If you write a similar program - add, modify,delete, view ,find - a country; you'll find that by changing only the file and field names in city maintenance program to that of country's - you'll have country maintenance ready.<br>
Go one step further. Find out all the other possibilities, make a program that asks for these options and generates all the required programs.<br>
e.g. suppose you want to write a program open a file. Your program generator would look like this.<br>
<br>
SET DEVI TO FILE "OPENDBF.PRG"<br>
@1,1 SAY 'SELE 0'<br>
@1,1 SAY 'USE ' + filetobeopened<br>
SET DEVI TO SCREEN<br>
<br>
......where filetobeopend is the variable you would be GETting before the above program section. You can also keep the name of prg, as variable.<br>
<br>
I have made a very extensive program generator in this manner. If I have, so you can...<br>
<br>
<br>
<br>
<br>
Then you'll find that only certain things change for a similar program.e.g. You have a Maintenance program for City Master file ( Fields : CityCode, Cityname). In your program you - add, modify,delete, view ,find - a city. Now consider a Country Master File ( fields : CtryCode,CtryName ). If you write a similar program - add, modify,delete, view ,find - a country; you'll find that by changing only the file and field names in city maintenance program to that of country's - you'll have country maintenance ready.<br>
Go one step further. Find out all the other possibilities, make a program that asks for these options and generates all the required programs.<br>
e.g. suppose you want to write a program open a file. Your program generator would look like this.<br>
<br>
SET DEVI TO FILE "OPENDBF.PRG"<br>
@1,1 SAY 'SELE 0'<br>
@1,1 SAY 'USE ' + filetobeopened<br>
SET DEVI TO SCREEN<br>
<br>
......where filetobeopend is the variable you would be GETting before the above program section. You can also keep the name of prg, as variable.<br>
<br>
I have made a very extensive program generator in this manner. If I have, so you can...<br>
<br>
<br>
<br>
<br>