home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a046 / 5.img / TEMPLATE / SSBMIS.GEN < prev    next >
Encoding:
Text File  |  1992-04-01  |  3.0 KB  |  102 lines

  1. <<* SSBMIS.GEN (Ver 1.1A) *>>
  2. <<* (C) 1991 SHEN YANG WHITE HORSE SOFTWART COMPANY  *>>
  3.  
  4. <<#
  5. title 'To generate the item of Procedure  with SSBMIS template.'
  6.  
  7. <<*---Declare global variables---*>>
  8. string  fpath,fname,fext
  9. string  prgpath,prgname,fileprefix,datafile
  10. string  response
  11. integer group
  12. logical ismultials
  13. logical Fox
  14.  
  15. <<*16-bit feature combinations (1...16)*>>
  16. <<*bits: 1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,-32768*>>
  17.  
  18. #>>
  19. <<*---General modules---*>>
  20. <<#include 'GENFILE.INC'#>>   <<*Contains GenHeader,GenFooter,etc.*>>
  21. <<#include 'GENCOLOR.INC'#>>  <<*Contains GenColor*>>
  22. <<#include 'GENLINE.INC'#>>
  23.  
  24. <<#
  25. procedure InitGlobals
  26. begin
  27.   fileprefix := substr( fname,1,7 )  <<*1st seven letters as prefix*>>
  28.   select database 1
  29.   filespec( dbfnam,fpath,datafile,fext )  <<*Init 'datafile'*>>
  30.   select all                     <<*Reset all scoping*>>
  31.   ismultials := (dbftotal > 1)   <<*Using more than 1 database?*>>
  32.   set lmargin to 0               <<*No left  margin offset*>>
  33.   set rmargin to 255             <<*No right margin wrap-around*>>
  34.   set AutoMem to true            <<*Gen with memvars*>>
  35. end <<*InitGlobals*>>
  36.  
  37.  
  38. procedure SubProgram( filename : string )
  39. string fspec,response
  40. begin
  41.   filespec( Template,fpath,fname,fext )  <<*Get current path*>>
  42.   fspec := fpath + filename
  43.   if file( fspec )
  44.     <<*---Pass information to subprograms via USER STACK---*>>
  45.     zapstack
  46.     push( datafile )     <<*filename of PRIMARY database file*>>
  47.     push( fileprefix )   <<*Three letter file prefix*>>
  48.     push( prgname )      <<*Filename of main program to generate*>>
  49.     push( prgpath )      <<*Pathname of main program to generate*>>
  50.     subprocess( fspec )
  51.   else
  52.     wait "File not found.  Cannot continue..." to response message fspec
  53.     HALT
  54.   endif
  55. end <<*SubProgram*>>
  56.  
  57.  
  58. procedure ExecGroups( group : integer )
  59. integer nextmenutype
  60. logical IsGroupAll,IsAllOthers
  61. logical IsGroup1,IsGroup2,IsGroup3,IsGroup4,IsGroup5
  62. begin
  63.   IsGroupAll := (group and  1) <> 0
  64.   IsGroup1 := (group and  2) <> 0
  65.   IsGroup2 := (group and  4) <> 0
  66.   IsGroup3 := (group and  8) <> 0
  67.   IsGroup4 := (group and 16) <> 0
  68.   IsGroup5 := (group and 32) <> 0
  69.   IsAllOthers := (group and (not 2)) <> 0
  70.   if IsAllOthers
  71.     if IsGroupAll or IsGroup2
  72.       SubProgram( 'SSB00.COD' )  <<*PROCEDURE file*>>
  73.       SubProgram( 'SSB01.COD' )  <<*PROCEDURE file*>>
  74.       SubProgram( 'SSB02.COD' )  <<*OPEN/MENU/APPE/UPDA*>>
  75.     endif
  76.     if IsGroupAll or IsGroup4
  77.       SubProgram( 'SSB03.COD' )  <<*BROW/EDIT/DISP/COND/FIND*>>
  78.     endif
  79.     if IsGroupAll or IsGroup5
  80.       SubProgram( 'SSB04.COD' )  <<*HELP/LABE/PACK/EXPR/ERROR/REPO*>>
  81.     endif
  82.   endif
  83. end ExecGroups
  84.  
  85.  
  86. begin <<*MAIN*>>
  87.   if Table
  88.     prgname := Table
  89.     filespec( prgname,prgpath,fname,fext )
  90.     if prgname
  91.       InitGlobals
  92.       group := 1 <<*all groups*>>
  93.       ExecGroups( group )
  94.     endif
  95.   else
  96.     wait 'No DATAFILE of SSBMIS available '
  97.   endif
  98. end <<*MAIN*>>
  99.  
  100. <<*EOF: SSBMIS.GEN*>>
  101. #>>
  102.