home *** CD-ROM | disk | FTP | other *** search
- <<* SSB03.GEN *>>
- <<* (C) 1991 SHEN YANG WHITE HORSE SOFTWART COMPANY *>>
-
- <<#pragma
-
- <<*---Declare global variables---*>>
- string fpath,fname,fext
- string prgpath,prgname,fileprefix,datafile
- string FuncStatus3
- string MenuLinehdg
- logical Simple,Bracketed,LiteBar
- logical Fox
- logical ismultipage,ismultials,ismultindx
-
- <<*---GENVARS vars---*>>
- string fldprefix
-
- <<*---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 'GENVARS.INC'#>> <<*Contains GenHeader,GenFooter,etc.*>>
- <<#include 'GENCOLOR.INC'#>> <<*Contains GenColor,etc.*>>
- <<#include 'GENLINE.INC'#>>
- <<*---Application---*>>
- <<#include 'SSBSETB.INC'#>>
- <<#include 'SSBPRIV.INC'#>>
- <<#include 'SSBBROW.INC'#>>
- <<#include 'SSBEDIT.INC'#>>
- <<#include 'SSBDISP.INC'#>>
- <<#include 'SSBCOND.INC'#>>
- <<#include 'SSBFIND.INC'#>>
- <<#include 'SSBFIME.INC'#>>
- <<#pragma
-
- procedure GenCommonPrgs
- string fspec,filename
- begin
- select all
- select database 1
- fspec := fileprefix + 'B.PRG'
- InitBrowse
- genln( ' ' )
- genln( 'PROCEDURE ',fspec )
- if (fldtotal > 0) or ismultials
- GenBrowseBody
- else
- GenBrowseSimple
- endif
- GenFooter( fspec )
-
- fspec := fileprefix + 'E.PRG'
- genln( ' ' )
- genln( 'PROCEDURE ',fspec )
- GenSBEditBody
- GenFooter( fspec )
-
- select all
- fspec := fileprefix + 'C.PRG'
- genln( ' ' )
- genln( 'PROCEDURE ',fspec )
- GenCondEdit
- GenFooter( fspec )
-
- if (FuncStatus3 = 'T') or (FuncStatus3 = 't')
- fspec := fileprefix + '3.PRG'
- genln( ' ' )
- genln( 'PROCEDURE ',fspec )
- SSBFindMenu
- GenFooter( fspec )
- endif
-
- fspec := fileprefix + 'Y.PRG'
- genln( ' ' )
- genln( 'PROCEDURE ',fspec )
- GenSBFindBody
- GenFooter( fspec )
-
- end GenCommonPrgs
-
- procedure GenDisplayPrg
- string fspec,filename,alpha
- begin
- select all
- filename := datafile + '.DBF'
- forall databases
- InitBrowse
- if ismultials
- fspec := substr(fileprefix,1,7) + 'D.' + chr(dbfcount + 64) + 'PR'
- else
- fspec := fileprefix + 'D.PRG'
- endif
- if fldtotal > 0
- genln( ' ' )
- genln( 'PROCEDURE ',fspec )
- GenDisplayBody
- GenFooter( fspec )
- endif
- endfor
- end GenDisplayPrg
-
- procedure InitVariables
- begin
- select databases 1
- FuncStatus3 := substr( dbfusr,3,1 )
- MenuLinehdg := substr ( dbfusr,73,(len( dbfusr ) - 72) )
- featals := 1 <<*fldals in Query Table*>>
- featlabel := 2
- featbrowse := 4
- SCREENWIDTH := 80
- 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
- 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 ) <<*Seven letter file prefix*>>
- pop( datafile ) <<*filename of PRIMARY database file*>>
- pop( features ) <<*feature combinations*>>
- zapstack
- end <<*InitFromStack*>>
-
- begin <<*MAIN*>>
- InitFromStack
- InitVariables
- GenCommonPrgs
- GenDisplayPrg
- end <<*MAIN*>>
-
- #>>
- <<*EOF: SSB03.GEN*>>
-