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
-
- <<*---BROWSE vars---*>>
- integer SCREENWIDTH
- integer PageIndent,PageWidth,panmax
- logical IsBigWid
- integer headlen,datalen
-
- <<*---FEATURE vars---*>>
- integer features
- integer featals,featlabel,featbrowse
-
-
- 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 'GENFILE.INC'#>> <<*Contains GenHeader,GenFooter,etc.*>>
- <<#include 'GENCOLOR.INC'#>> <<*Contains GenColor,etc.*>>
- <<#include 'SHADE.INC'#>>
- <<*---Application---*>>
- <<#include 'msaSETB.INC'#>>
- <<#include 'msaBROW.INC'#>>
- <<#include 'msaDISP.INC'#>>
- <<#include 'msaQUERY.INC'#>>
- <<#include 'msaEXPR.INC'#>>
- <<#include 'msaPHRA.INC'#>>
- <<#include 'msaCOND.INC'#>>
- <<#include 'msaMISC.INC'#>>
- <<#include 'msaINST.INC'#>>
- <<#include 'msaBAK.INC'#>>
- <<#include 'msaREST.INC'#>>
- <<#pragma
-
-
- procedure GenCommonPrgs
- string fspec,filename
- begin
- select all
- select database 1
- filename := datafile + '.DBF'
- fspec := pathfileprefix + '_BROW.PRG'
- InitBrowse
- if OpenFile( fspec,'BROWSE program for ' + filename )
- if (fldtotal > 0) or ismultials
- GenBrowseBody
- else
- GenBrowseSimple
- endif
- GenFooter( fspec )
- endif
- select all
- fspec := pathfileprefix + '_EXPR.PRG'
- if OpenFile( fspec,'EXPRESSION program for ' + filename )
- GenExprBody
- GenFooter( fspec )
- endif
- fspec := pathfileprefix + '_COND.PRG'
- if OpenFile( fspec,'CONDITION program for ' + filename )
- GenCondBody
- GenFooter( fspec )
- endif
- fspec := pathfileprefix + '_MISC.PRG'
- if OpenFile( fspec,'MISCELLANEOUS program for ' + filename )
- GenMisc
- GenFooter( fspec )
- endif
- fspec := pathfileprefix + '_INST.PRG'
- if OpenFile( fspec,'INSTALL program for ' + filename )
- GenInstall
- GenFooter( fspec )
- endif
- fspec := pathfileprefix + '_BAK.PRG'
- if OpenFile( fspec,'BACKUP program for ' + filename )
- GenBak
- GenFooter( fspec )
- endif
- fspec := pathfileprefix + '_REST.PRG'
- if OpenFile( fspec,'RESTORE program for ' + filename )
- GenRest
- GenFooter( fspec )
- endif
- end GenCommonPrgs
-
-
- procedure GenDisplayPrg
- string fspec,filename,alpha
- begin
- select all
- filename := datafile + '.DBF'
- forall databases
- InitBrowse
- if ismultials
- fspec := pathfileprefix + '_' + chr( dbfcount + 64 ) + 'DIS.PRG'
- else
- fspec := pathfileprefix + '_DISP.PRG'
- endif
- if fldtotal > 0
- if OpenFile( fspec,'DISPLAY program for ' + filename )
- GenDisplayBody
- GenFooter( fspec )
- endif
- endif
- endfor
- end GenDisplayPrg
-
-
- procedure GenAllPhrase
- string fspec,filename
- begin
- select all databases
- filename := datafile + '.DBF'
- if fldtotal > 0
- fspec := pathfileprefix + '_PHRA.PRG'
- if OpenFile( fspec,'PHRASE program for ' + filename )
- GenPhraseBody
- GenFooter( fspec )
- endif
- endif
- end GenAllPhrase
-
-
- procedure GenMultiPhrase
- string fspec,filename,alpha
- begin
- select all
- filename := datafile + '.DBF'
- forall databases
- if ismultials
- fspec := pathfileprefix + '_' + chr( dbfcount + 64 ) + 'PHR.PRG'
- else
- fspec := pathfileprefix + '_PHRA.PRG'
- endif
- if fldtotal > 0
- if OpenFile( fspec,'PHRASE program for ' + filename )
- GenPhraseBody
- GenFooter( fspec )
- endif
- endif
- endfor
- end GenMultiPhrase
-
-
- procedure InitVariables
- begin
- featals := 1 <<*fldals in Query Table*>>
- featlabel := 2
- featbrowse := 4
- SCREENWIDTH := 80
- <<*---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)
- 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*>>
- zapstack
- end <<*InitFromStack*>>
-
-
- begin <<*MAIN*>>
- InitFromStack
- InitVariables
- GenCommonPrgs
- GenDisplayPrg
- if ismultials and feat(featals)
- GenAllPhrase
- else
- GenMultiPhrase
- endif
- end <<*MAIN*>>
-
- <<*EOF: MASC.GEN*>>
- #>>