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

  1. <<* SIMPLE.GEN *>>
  2. <<title "Simple Database Application">>
  3. <<string fmain,fproc>>
  4. <<integer errnum>>
  5.  
  6. <<#include 'SIMUTIL.INC'#>>  <<*Routines used by SIMPROC*>>
  7. <<#include 'SIMPROC.INC'#>>  <<*Procedure file*>>
  8. <<#include 'SIMMAIN.INC'#>>  <<*Main program file*>>
  9.  
  10. <<#pragma
  11.  
  12. function GetPrgName( prompt : string ) : string
  13. string fspec,fpath,fname,fext
  14. begin
  15.   input prompt to fspec
  16.   if fspec
  17.     filespec( fspec,fpath,fname,fext )
  18.     fspec := fpath + fname + '.PRG'  <<*Force a '.PRG' extension*>>
  19.   endif
  20.   RETURN fspec
  21. end <<*GetPrgName*>>
  22.  
  23.  
  24. begin <<*MAIN*>>
  25.   if table
  26.     fmain := GetPrgName( "Enter FILENAME of program to GENERATE" )
  27.     fproc := GetPrgName( "Enter FILENAME of procedure file to GENERATE" )
  28.     if fmain and fproc
  29.       errnum := rewrite( fmain )
  30.       if errnum = 0
  31.         ProgramBody( fproc )
  32.         errnum := rewrite( fproc )
  33.         if errnum = 0
  34.           ProcedureBody
  35.         endif
  36.       endif
  37.       wait
  38.     endif
  39.   else
  40.     wait "No FoxView Table is available "
  41.   endif
  42. end <<*MAIN*>>
  43. #>>
  44.  
  45. <<* EOF: SIMPLE.GEN *>>
  46.