home *** CD-ROM | disk | FTP | other *** search
- <<* MSA_1.GEN (version 1) *>>
- <<* (C) 1988 MicroSearch Associates *>>
-
- <<#
- title 'FoxBASE File System. FoxBase+ V/2.10 (C) MicroSearch Assoc.'
-
- <<*---Declare global variables---*>>
- string fpath,fname,fext
- string prgpath,prgname,fileprefix,datafile
- integer menutype,group,features
- logical ismultials
- logical Fox
- string response,menutitle
-
- <<*---FEATURE vars---*>>
- integer features
- integer featals,featlabel,featbrowse
-
- <<*16-bit feature combinations (1...16)*>>
- <<*bits: 1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,-32768*>>
-
- #>>
- <<*---General modules---*>>
- <<#include 'GENPRG.INC'#>> <<*Contains GetPrgName,etc.*>>
- <<#include 'GENFILE.INC'#>> <<*Contains GenHeader,GenFooter,etc.*>>
- <<#include 'GENCOLOR.INC'#>> <<*Contains GenColor*>>
- <<#include 'SHADE.INC'#>>
- <<*---Application modules---*>>
- <<#include 'msaMBAR.INC'#>> <<*Contains main Bar Menu *>>
- <<#include 'msaCALL.INC'#>> <<*Contains ExecGroup,etc.*>>
-
- <<#
- procedure InitGlobals
- begin
- Fox := (ProductCode = 1) <<*---Product vars for MENU program---*>>
- filespec( prgname,fpath,fname,fext ) <<*split 'prgname' to get filename*>>
- fileprefix := substr( fname+'___',1,3 ) <<*1st three letters as prefix*>>
- select database 1
- filespec( dbfnam,fpath,datafile,fext ) <<*Init 'datafile'*>>
- select all <<*Reset all scoping*>>
- ismultials := (dbftotal > 1) <<*Using more than 1 database?*>>
- set lmargin to 0 <<*No left margin offset*>>
- set rmargin to 255 <<*No right margin wrap-around*>>
- set AutoMem to true <<*Gen with memvars*>>
- end <<*InitGlobals*>>
-
-
- procedure SubProgram( filename : string )
- string fspec,response
- begin
- filespec( Template,fpath,fname,fext ) <<*Get current path*>>
- fspec := fpath + filename
- if file( fspec )
- <<*---Pass information to subprograms via USER STACK---*>>
- zapstack
- push( features ) <<*feature combinations*>>
- push( menutype ) <<*Submenu prompt type*>>
- push( datafile ) <<*filename of PRIMARY database file*>>
- push( fileprefix ) <<*Three letter file prefix*>>
- push( prgname ) <<*Filename of main program to generate*>>
- push( prgpath ) <<*Pathname of main program to generate*>>
- subprocess( fspec )
- else
- wait "File not found. Cannot continue..." to response message fspec
- HALT
- endif
- end <<*SubProgram*>>
-
-
- procedure ExecGroups( group : integer )
- integer nextmenutype
- logical IsGroupAll,IsAllOthers
- logical IsGroup1,IsGroup2,IsGroup3,IsGroup4,IsGroup5
- begin
- IsGroupAll := (group and 1) <> 0
- IsGroup1 := (group and 2) <> 0
- IsGroup2 := (group and 4) <> 0
- IsGroup3 := (group and 8) <> 0
- IsGroup4 := (group and 16) <> 0
- IsGroup5 := (group and 32) <> 0
- IsAllOthers := (group and (not 2)) <> 0
- if IsGroupAll or IsGroup1
- menutype := MainMenuType
- endif
- if IsAllOthers
- nextmenutype := SubMenuType <<*Save submenu selection*>>
- endif
- if IsGroupAll or IsGroup1
- filespec( prgname,fpath,menutitle,fext ) <<*Assign global 'menutitle'*>>
- GenMainMenu( menutype )
- endif
- menutype := nextmenutype <<*"menutype" is passed onto groups*>>
- if IsAllOthers
- if IsGroupAll or IsGroup2
- SubProgram( 'msa_1.000' ) <<*PROCEDURE file*>>
- endif
- if IsGroupAll or IsGroup3
- SubProgram( 'msa_1.001' ) <<*MAIN/OPEN/APPE/EDIT*>>
- endif
- if IsGroupAll or IsGroup4
- SubProgram( 'msa_1.002' ) <<*BROW/DISP/COND/EXPR/PHRA*>>
- endif
- if IsGroupAll or IsGroup5
- SubProgram( 'msa_1.003' ) <<*HELP/LABE/PACK/REPO*>>
- endif
- endif
- end ExecGroups
-
-
- begin <<*MAIN*>>
- if Table
- prgname := GetPrgName( "Enter FILENAME of program to GENERATE" )
- filespec( prgname,prgpath,fname,fext )
- if prgname
- InitGlobals
- <<* wait "Do you want Special Features? (y/n) " to response
- if response = 'Y'
- features := SelectFeatures
- endif ABOVE COMMENTED OUT *>>
- group := 1 <<*all groups*>>
- wait "Generate Specific Modules? (y/n) " to response
- if response = 'Y'
- group := SelectGroup <<*select groups of programs to generate*>>
- endif
- ExecGroups( group )
- endif
- else
- wait 'No FoxView Table is available '
- endif
- end <<*MAIN*>>
-
- <<*EOF: MSA_1.GEN*>>
- #>>