home *** CD-ROM | disk | FTP | other *** search
- <<* SSB04.GEN *>>
- <<* (C) 1991 SHEN YANG WHITE HORSE SOFTWART COMPANY *>>
-
- <<#pragma
- <<*---Declare global variables---*>>
- string fpath,fname,fext
- string prgpath,prgname,fileprefix,datafile
- string FuncStatus5
- logical Fox
- logical ismultipage,ismultials,ismultindx
- integer menutype
-
- #>>
- <<*---General modules---*>>
- <<#include 'GENFILE.INC'#>> <<*Contains GenHeader,GenFooter,etc.*>>
- <<#include 'GENCOLOR.INC'#>>
- <<#include 'GENLINE.INC'#>>
- <<*---Application---*>>
- <<#include 'SSBPACK.INC'#>>
- <<#include 'SSBERROR.INC'#>>
- <<*---Specific modules---*>>
- <<#include 'GENPRINT.INC'#>>
- <<#pragma
-
- procedure GenPrograms
- string fspec,filename
- begin
-
- fspec := fileprefix + 'M.PRG'
- genln( ' ' )
- genln( 'PROCEDURE ',fspec )
- GenPackItBody
- GenFooter( fspec )
-
- fspec := fileprefix + 'N.PRG'
- genln( ' ' )
- genln( 'PROCEDURE ',fspec )
- GenPackBody
- GenFooter( fspec )
-
- if (FuncStatus5 = 'T') or (FuncStatus5 = 't')
- prgname := prgpath + fileprefix + '0.FDP'
- if load( prgname ) = 0
- fspec := fileprefix + '5.PRG'
- genln( ' ' )
- genln( 'PROCEDURE ',fspec )
- ssbprintfmt
- GenFooter(fspec)
- endif
- endif
-
- fspec := 'SYSERROR.PRG'
- if OpenFile( fspec,'PACK program for ' + filename )
- GenSBSystemError
- GenFooter( fspec )
- end
- end <<*GenPrograms*>>
-
- procedure InitVariables
- begin
- select databases 1
- FuncStatus5 := substr( dbfusr,5,1 )
- <<*---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
- 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*>>
- end <<*InitFromStack*>>
-
-
- begin <<*MAIN*>>
- InitFromStack
- InitVariables
- GenPrograms
- end <<*MAIN*>>
-
- <<*EOF: SSB04.GEN*>>
- #>>
-