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

  1. <<* SSB04.GEN *>>
  2. <<* (C) 1991 SHEN YANG WHITE HORSE SOFTWART COMPANY  *>>
  3.  
  4. <<#pragma
  5. <<*---Declare global variables---*>>
  6. string  fpath,fname,fext
  7. string  prgpath,prgname,fileprefix,datafile
  8. string  FuncStatus5
  9. logical Fox
  10. logical ismultipage,ismultials,ismultindx
  11. integer menutype
  12.  
  13. #>>
  14. <<*---General modules---*>>
  15. <<#include 'GENFILE.INC'#>>  <<*Contains GenHeader,GenFooter,etc.*>>
  16. <<#include 'GENCOLOR.INC'#>>
  17. <<#include 'GENLINE.INC'#>>
  18. <<*---Application---*>>
  19. <<#include 'SSBPACK.INC'#>>
  20. <<#include 'SSBERROR.INC'#>>
  21. <<*---Specific modules---*>>
  22. <<#include 'GENPRINT.INC'#>>
  23. <<#pragma
  24.  
  25. procedure GenPrograms
  26. string fspec,filename
  27. begin
  28.  
  29.   fspec := fileprefix + 'M.PRG'
  30.    genln( ' ' )
  31.    genln( 'PROCEDURE ',fspec )
  32.     GenPackItBody
  33.     GenFooter( fspec )
  34.  
  35.   fspec := fileprefix + 'N.PRG'
  36.    genln( ' ' )
  37.    genln( 'PROCEDURE ',fspec )
  38.     GenPackBody
  39.     GenFooter( fspec )
  40.  
  41.   if (FuncStatus5 = 'T') or (FuncStatus5 = 't')
  42.     prgname := prgpath + fileprefix + '0.FDP'
  43.     if load( prgname ) = 0
  44.       fspec := fileprefix + '5.PRG'
  45.       genln( ' ' )
  46.       genln( 'PROCEDURE ',fspec )
  47.       ssbprintfmt
  48.       GenFooter(fspec)
  49.     endif
  50.   endif
  51.  
  52.   fspec := 'SYSERROR.PRG'
  53.   if OpenFile( fspec,'PACK program for ' + filename )
  54.     GenSBSystemError
  55.     GenFooter( fspec )
  56.   end
  57. end <<*GenPrograms*>>
  58.  
  59. procedure InitVariables
  60. begin
  61.   select databases 1
  62.   FuncStatus5 := substr( dbfusr,5,1 )
  63.   <<*---Init Product logical vars---*>>
  64.   Fox     := (ProductCode = 1)
  65.   select all
  66.   ismultipage := (pagtotal > 1)
  67.   ismultials := (dbftotal > 1)
  68.   ismultindx := false
  69.   forall databases
  70.     if ndxtotal > 1
  71.       ismultindx := true
  72.     endif
  73.   endfor
  74. end <<*InitVariables*>>
  75.  
  76.  
  77. procedure InitFromStack
  78. begin
  79.   <<*---Restore stack variables in REVERSE order---*>>
  80.   pop( prgpath )       <<*Pathname of main program to generate*>>
  81.   pop( prgname )       <<*Filename of main program to generate*>>
  82.   pop( fileprefix )    <<*Three letter file prefix*>>
  83.   pop( datafile )      <<*filename of PRIMARY database file*>>
  84.   pop( menutype )      <<*Menu/Submenu prompt type*>>
  85. end <<*InitFromStack*>>
  86.  
  87.  
  88. begin <<*MAIN*>>
  89.   InitFromStack
  90.   InitVariables
  91.   GenPrograms
  92. end <<*MAIN*>>
  93.  
  94. <<*EOF: SSB04.GEN*>>
  95. #>>
  96.