home *** CD-ROM | disk | FTP | other *** search
- <<#pragma
-
- <<*---Declare global variables---*>>
- string fpath,fname,fext
- string prgpath,prgname,fileprefix,datafile,pathfileprefix
- logical Simple,Bracketed,LiteBar
- logical Fox
- logical ismultipage,ismultials,ismultindx
- integer menutype
-
- <<*---OPEN vars---*>>
- integer SCREENWIDTH
-
- <<*---GENVARS vars---*>>
- string fldprefix
-
- <<*---FEATURE vars---*>>
- integer features
- integer featals,featlabel
-
-
- function feat( num : integer ) : logical
- <<*16-bit feature combinations (1...16)*>>
- <<*bits: 1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,-32768*>>
- begin
- RETURN (features and num) <> 0
- end feat
-
- #>>
- <<*---General modules---*>>
- <<#include 'GENSAY.INC'#>> <<*To generate @row,col SAY,etc.*>>
- <<#include 'GENSTR.INC'#>> <<*General string functions*>>
- <<#include 'GENVARS.INC'#>> <<*Contains fixfldnam,GenMemVars,etc.*>>
- <<#include 'GENFILE.INC'#>> <<*Contains GenHeader,GenFooter,etc.*>>
- <<#include 'GENCOLOR.INC'#>> <<*Contains GenColor,etc.*>>
- <<*---Application---*>>
- <<#include 'msaFILE.INC'#>> <<*General routines used by others*>>
- <<#include 'msaPRIV.INC'#>> <<*Special routines for APPE/EDIT*>>
- <<#include 'msaMAIN.INC'#>>
- <<#include 'msaLOGO.INC'#>>
- <<#include 'msaOPEN.INC'#>>
- <<#include 'msaEDONE.INC'#>>
- <<#include 'msaEDIT.INC'#>>
- <<#include 'msaAPPE.INC'#>>
- <<#include 'msaLAB1.INC'#>>
- <<#include 'REPUTIL.INC'#>>
- <<#include 'msaRPT1.INC'#>>
- <<#include 'msaQUIT.INC'#>>
- <<#pragma
-
-
- procedure GenMainPrg
- begin
- <<* 'prgname' includes PATHNAME *>>
- if OpenFile( prgname,'MAIN program for ' + datafile + '.DBF' )
- GenMainBody
- GenFooter( prgname )
- end
- end <<*GenMainPrg*>>
-
-
- procedure GenPrograms
- string fspec,filename
- begin
- filename := datafile + '.DBF'
- fspec := pathfileprefix + '_QUIT.PRG'
- if OpenFile( fspec,'QUIT program for ' + filename )
- GenQuit
- GenFooter( fspec )
- end
- filename := datafile + '.DBF'
- fspec := pathfileprefix + '_LOGO.PRG'
- if OpenFile( fspec,'LOGO program for ' + filename )
- GenLogo
- GenFooter( fspec )
- end
- fspec := pathfileprefix + '_OPEN.PRG'
- if OpenFile( fspec,'OPEN program for ' + filename )
- GenOpenBody
- GenFooter( fspec )
- end
- fspec := pathfileprefix + '_EDIT.PRG'
- if OpenFile( fspec,'EDIT program for ' + filename )
- GenEditBody
- GenFooter( fspec )
- end
- fspec := pathfileprefix + '_APPE.PRG'
- if OpenFile( fspec,'APPEND program for ' + filename )
- GenAppendBody
- GenFooter( fspec )
- end
- select all
- select database 1
- if feat(featlabel)
- fspec := pathfileprefix + '_1LAB.PRG'
- if OpenFile( fspec,'Print ONE LABEL program for ' + filename )
- GenOneLabel
- GenFooter( fspec )
- endif
- fspec := pathfileprefix + '_1RPT.PRG'
- if OpenFile( fspec,'Print SINGLE RECORD program for ' + filename )
- GenOneReport
- GenFooter( fspec )
- endif
- endif
- end <<*GenPrograms*>>
-
-
- procedure InitVariables
- begin
- SCREENWIDTH := 0
- fldprefix := 'm' <<*FIELD_NAME prefix when using memvars*>>
- <<*---Init Product logical vars---*>>
- Fox := (ProductCode = 1)
- select all
- ismultipage := (pagtotal > 1)
- ismultials := (dbftotal > 1)
- ismultindx := false
- forall databases
- if ndxtotal > 1
- ismultindx := true
- endif
- endfor
- <<*---Select Menu Type---*>>
- Bracketed := (menutype = 0) <<*Default, if they press ESC*>>
- Simple := (menutype = 1)
- Bracketed := (menutype = 2)
- LiteBar := (menutype = 3)
- featlabel := 2
- pathfileprefix := prgpath + fileprefix
- end <<*InitVariables*>>
-
-
- procedure InitFromStack
- begin
- <<*---Restore stack variables in REVERSE order---*>>
- pop( prgpath ) <<*Pathname of main program to generate*>>
- pop( prgname ) <<*Filename of main program to generate*>>
- pop( fileprefix ) <<*Three letter file prefix*>>
- pop( datafile ) <<*filename of PRIMARY database file*>>
- pop( menutype ) <<*Menu/Submenu prompt type*>>
- pop( features ) <<*feature combinations*>>
- end <<*InitFromStack*>>
-
-
- begin <<*MAIN*>>
- InitFromStack
- InitVariables
- select all
- GenMainPrg
- GenPrograms
- end
-
- <<*EOF: MSAB.GEN*>>
- #>>