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

  1. <<title 'Driver with FORM/SAYS/GETS/STOR/REPL procedure file'>>
  2. <<#
  3.  
  4. <<*---Declare global variables---*>>
  5. string  fpath,fname,fext
  6. string  prgname,fileprefix,datafile
  7. integer menutype,group
  8. logical ismultials,ismultipage,ismultindx
  9. logical Simple,Bracketed,LiteBar
  10. string  fldprefix,procfile
  11.  
  12. <<*---GENHUE vars---*>>
  13. integer lasthue,forecolor,backcolor
  14.  
  15. #>>
  16. <<*---General modules---*>>
  17. <<#include 'GENPRG.INC'#>>   <<*Contains GetPrgName,etc.*>>
  18. <<#include 'GENSAY.INC'#>>   <<*To generate @row,col SAY,etc.*>>
  19. <<#include 'GENBOX.INC'#>>   <<*To generate boxes,etc.*>>
  20. <<#include 'GENHUE.INC'#>>   <<*Contains AtrCode,etc.*>>
  21. <<#include 'GENFLD.INC'#>>   <<*Contains GenLabel,GenField,etc.*>>
  22. <<#include 'GENVARS.INC'#>>  <<*Contains fixfldnam,GenMemVars,etc.*>>
  23. <<#include 'GENFILE.INC'#>>  <<*Contains GenHeader,GenFooter,etc.*>>
  24. <<#include 'GENCOLOR.INC'#>> <<*Contains GenColor*>>
  25. <<*---Specific modules---*>>
  26. <<#include 'Ap1FORM.INC'#>>
  27. <<#include 'Ap1SAYS.INC'#>>
  28. <<#include 'Ap1GETS.INC'#>>
  29. <<#include 'Ap1REPL.INC'#>>
  30. <<#include 'Ap1KEYS.INC'#>>
  31. <<#include 'Ap1CALC.INC'#>>
  32. <<#include 'FMTMAIN.INC'#>>
  33. <<#include 'FMTPROC.INC'#>>
  34. <<#
  35.  
  36. procedure InitGlobals
  37. begin
  38.   filespec( prgname,fpath,fname,fext )   <<*split 'prgname' to get filename*>>
  39.   fileprefix := substr( fname,1,3 )      <<*use 1st three letters as prefix*>>
  40.   procfile := fpath + fileprefix + '_PROC.PRG'
  41.   select all                     <<*Reset all scoping*>>
  42.   ismultials := (dbftotal > 1)   <<*Using more than 1 database?*>>
  43.   ismultipage := (pagtotal > 1)
  44.   select database 1
  45.   filespec( dbfnam,fpath,datafile,fext )  <<*Init 'datafile'*>>
  46.   set AutoMem to true
  47.   fldprefix := 'm'
  48.   ismultindx := false
  49.   forall databases
  50.     if ndxtotal > 1
  51.       ismultindx := true
  52.     endif
  53.   endfor
  54.   <<*---Select Menu Type---*>>
  55.   Bracketed := (menutype = 0)  <<*Default, if they press ESC*>>
  56.   Simple    := (menutype = 1)
  57.   Bracketed := (menutype = 2)
  58.   LiteBar   := (menutype = 3)
  59. end <<*InitGlobals*>>
  60.  
  61.  
  62. procedure GenMainFile( fspec : string )
  63. begin
  64.   if OpenFile( fspec,'SAMPLE driver for ' + datafile + '.DBF' )
  65.     GenDriverPrg( fspec )
  66.     GenFooter( fspec )
  67.   endif
  68. end GenMainFile
  69.  
  70.  
  71. begin <<*MAIN*>>
  72.   if Table
  73.     prgname := GetPrgName( "Enter FILENAME of program to GENERATE" )
  74.     if prgname
  75.       InitGlobals
  76.       GenMainFile( prgname )
  77.       GenProcFile( procfile )   <<*'procfile' is derived in InitGlobals*>>
  78.     endif
  79.   else
  80.     wait 'No FoxView Table is available '
  81.   endif
  82. end <<*MAIN*>>
  83.  
  84. <<*EOF: FORMAT.GEN*>>
  85. #>>
  86.