home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a070 / 3.ddi / FOXPRO / TEMPLGEN / AP1D.GEN < prev    next >
Encoding:
Text File  |  1988-02-10  |  2.0 KB  |  81 lines

  1. <<#pragma
  2.  
  3. <<*---Declare global variables---*>>
  4. string  fpath,fname,fext
  5. string  prgpath,prgname,fileprefix,datafile,pathfileprefix
  6. logical ismultipage,ismultials
  7. integer menutype
  8.  
  9. #>>
  10. <<*---General modules---*>>
  11. <<#include 'GENFILE.INC'#>>
  12. <<#include 'GENCOLOR.INC'#>>
  13. <<*---Application---*>>
  14. <<#include 'Ap1HELP.INC'#>>
  15. <<#include 'Ap1LABE.INC'#>>
  16. <<#include 'Ap1PACK.INC'#>>
  17. <<#include 'Ap1REPO.INC'#>>
  18. <<#pragma
  19.  
  20.  
  21. procedure GenPrograms
  22. string fspec,filename
  23. begin
  24.   filename := datafile + '.DBF'
  25.   fspec := pathfileprefix + '_HELP.PRG'
  26.   if OpenFile( fspec,'HELP program for ' + filename )
  27.     GenHelpBody
  28.     GenFooter( fspec )
  29.   end
  30.   fspec := pathfileprefix + '_LABE.PRG'
  31.   if OpenFile( fspec,'LABEL program for ' + filename )
  32.     GenLabelBody
  33.     GenFooter( fspec )
  34.   end
  35.   fspec := pathfileprefix + '_PACK.PRG'
  36.   if OpenFile( fspec,'PACK driver program for ' + filename )
  37.     GenPackItBody
  38.     GenFooter( fspec )
  39.   end
  40.   fspec := pathfileprefix + '_APAC.PRG'
  41.   if OpenFile( fspec,'PACK program for ' + filename )
  42.     GenPackBody
  43.     GenFooter( fspec )
  44.   end
  45.   fspec := pathfileprefix + '_REPO.PRG'
  46.   if OpenFile( fspec,'REPORT program for ' + filename )
  47.     GenReportBody
  48.     GenFooter( fspec )
  49.   end
  50. end <<*GenPrograms*>>
  51.  
  52.  
  53. procedure InitVariables
  54. begin
  55.   select all
  56.   ismultipage := (pagtotal > 1)
  57.   ismultials := (dbftotal > 1)
  58.   pathfileprefix := prgpath + fileprefix
  59. end <<*InitVariables*>>
  60.  
  61.  
  62. procedure InitFromStack
  63. begin
  64.   <<*---Restore stack variables in REVERSE order---*>>
  65.   pop( prgpath )       <<*Pathname of main program to generate*>>
  66.   pop( prgname )       <<*Filename of main program to generate*>>
  67.   pop( fileprefix )    <<*Three letter file prefix*>>
  68.   pop( datafile )      <<*filename of PRIMARY database file*>>
  69.   pop( menutype )      <<*Menu/Submenu prompt type*>>
  70. end <<*InitFromStack*>>
  71.  
  72.  
  73. begin <<*MAIN*>>
  74.   InitFromStack
  75.   InitVariables
  76.   GenPrograms
  77. end <<*MAIN*>>
  78.  
  79. <<*EOF: APPS.GEN*>>
  80. #>>
  81.