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

  1. <<* SSB03.GEN *>>
  2. <<* (C) 1991 SHEN YANG WHITE HORSE SOFTWART COMPANY  *>>
  3.  
  4. <<#pragma
  5.  
  6. <<*---Declare global variables---*>>
  7. string  fpath,fname,fext
  8. string  prgpath,prgname,fileprefix,datafile
  9. string  FuncStatus3
  10. string  MenuLinehdg
  11. logical Simple,Bracketed,LiteBar
  12. logical Fox
  13. logical ismultipage,ismultials,ismultindx
  14.  
  15. <<*---GENVARS vars---*>>
  16. string  fldprefix
  17.  
  18. <<*---BROWSE vars---*>>
  19. integer SCREENWIDTH
  20. integer PageIndent,PageWidth,panmax
  21. logical IsBigWid
  22. integer headlen,datalen
  23.  
  24. <<*---FEATURE vars---*>>
  25. integer features
  26. integer featals,featlabel,featbrowse
  27.  
  28.  
  29. function feat( num : integer ) : logical
  30. <<*16-bit feature combinations (1...16)*>>
  31. <<*bits: 1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,-32768*>>
  32. begin
  33.   RETURN (features and num) <> 0
  34. end feat
  35.  
  36. #>>
  37. <<*---General modules---*>>
  38. <<#include 'GENFILE.INC'#>>  <<*Contains GenHeader,GenFooter,etc.*>>
  39. <<#include 'GENVARS.INC'#>>  <<*Contains GenHeader,GenFooter,etc.*>>
  40. <<#include 'GENCOLOR.INC'#>> <<*Contains GenColor,etc.*>>
  41. <<#include 'GENLINE.INC'#>>
  42. <<*---Application---*>>
  43. <<#include 'SSBSETB.INC'#>>
  44. <<#include 'SSBPRIV.INC'#>>
  45. <<#include 'SSBBROW.INC'#>>
  46. <<#include 'SSBEDIT.INC'#>>
  47. <<#include 'SSBDISP.INC'#>>
  48. <<#include 'SSBCOND.INC'#>>
  49. <<#include 'SSBFIND.INC'#>>
  50. <<#include 'SSBFIME.INC'#>>
  51. <<#pragma
  52.  
  53. procedure GenCommonPrgs
  54. string fspec,filename
  55. begin
  56.    select all
  57.    select database 1
  58.    fspec := fileprefix + 'B.PRG'
  59.    InitBrowse
  60.    genln( ' ' )
  61.    genln( 'PROCEDURE ',fspec )
  62.    if (fldtotal > 0) or ismultials
  63.       GenBrowseBody
  64.    else
  65.      GenBrowseSimple
  66.    endif
  67.    GenFooter( fspec )
  68.  
  69.    fspec := fileprefix + 'E.PRG'
  70.    genln( ' ' )
  71.    genln( 'PROCEDURE ',fspec )
  72.     GenSBEditBody
  73.     GenFooter( fspec )
  74.  
  75.   select all
  76.    fspec := fileprefix + 'C.PRG'
  77.    genln( ' ' )
  78.    genln( 'PROCEDURE ',fspec )
  79.     GenCondEdit
  80.     GenFooter( fspec )
  81.  
  82.   if (FuncStatus3 = 'T') or (FuncStatus3 = 't')
  83.     fspec := fileprefix + '3.PRG'
  84.     genln( ' ' )
  85.     genln( 'PROCEDURE ',fspec )
  86.     SSBFindMenu
  87.     GenFooter( fspec )
  88.   endif
  89.  
  90.    fspec := fileprefix + 'Y.PRG'
  91.    genln( ' ' )
  92.    genln( 'PROCEDURE ',fspec )
  93.     GenSBFindBody
  94.     GenFooter( fspec )
  95.  
  96. end GenCommonPrgs
  97.  
  98. procedure GenDisplayPrg
  99. string fspec,filename,alpha
  100. begin
  101.   select all
  102.   filename := datafile + '.DBF'
  103.   forall databases
  104.     InitBrowse
  105.     if ismultials
  106.       fspec := substr(fileprefix,1,7) + 'D.' + chr(dbfcount + 64) + 'PR'
  107.     else
  108.       fspec := fileprefix + 'D.PRG'
  109.     endif
  110.     if fldtotal > 0
  111.        genln( ' ' )
  112.        genln( 'PROCEDURE ',fspec )
  113.        GenDisplayBody
  114.        GenFooter( fspec )
  115.     endif
  116.   endfor
  117. end GenDisplayPrg
  118.  
  119. procedure InitVariables
  120. begin
  121.   select databases 1
  122.   FuncStatus3 := substr( dbfusr,3,1 )
  123.   MenuLinehdg := substr ( dbfusr,73,(len( dbfusr ) - 72) )
  124.   featals := 1     <<*fldals in Query Table*>>
  125.   featlabel := 2
  126.   featbrowse := 4
  127.   SCREENWIDTH := 80
  128.   fldprefix := 'm'   <<*FIELD_NAME prefix when using memvars*>>
  129.   <<*---Init Product logical vars---*>>
  130.   Fox     := (ProductCode = 1)
  131.   select all
  132.   ismultipage := (pagtotal > 1)
  133.   ismultials := (dbftotal > 1)
  134.   ismultindx := false
  135.   forall databases
  136.     if ndxtotal > 1
  137.       ismultindx := true
  138.     endif
  139.   endfor
  140. end <<*InitVariables*>>
  141.  
  142. procedure InitFromStack
  143. begin
  144.   <<*---Restore stack variables in REVERSE order---*>>
  145.   pop( prgpath )       <<*Pathname of main program to generate*>>
  146.   pop( prgname )       <<*Filename of main program to generate*>>
  147.   pop( fileprefix )    <<*Seven letter file prefix*>>
  148.   pop( datafile )      <<*filename of PRIMARY database file*>>
  149.   pop( features )      <<*feature combinations*>>
  150.   zapstack
  151. end <<*InitFromStack*>>
  152.  
  153. begin <<*MAIN*>>
  154.   InitFromStack
  155.   InitVariables
  156.   GenCommonPrgs
  157.   GenDisplayPrg
  158. end <<*MAIN*>>
  159.  
  160. #>>
  161. <<*EOF: SSB03.GEN*>>
  162.