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

  1. <<* SSB02.GEN *>>
  2. <<* (C) 1991 SHEN YANG WHITE HORSE SOFTWART COMPANY  *>>
  3. <<#pragma
  4.  
  5. <<*---Declare global variables---*>>
  6. string  fpath,fname,fext
  7. string  prgpath,prgname,fileprefix,datafile
  8. string  FuncStatus1,FuncStatus2
  9. logical Simple,Bracketed,LiteBar
  10. logical Fox
  11. logical ismultipage,ismultials,ismultindx
  12.  
  13. <<*---BROWSE vars---*>>
  14. integer SCREENWIDTH
  15. integer PageIndent,PageWidth,panmax
  16. logical IsBigWid
  17. integer headlen,datalen
  18.  
  19. <<*---GENVARS vars---*>>
  20. string  fldprefix
  21.  
  22. <<*---FEATURE vars---*>>
  23. integer features
  24. integer featals,featlabel
  25.  
  26.  
  27. function feat( num : integer ) : logical
  28. <<*16-bit feature combinations (1...16)*>>
  29. <<*bits: 1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,-32768*>>
  30. begin
  31.   RETURN (features and num) <> 0
  32. end feat
  33.  
  34. #>>
  35. <<*---General modules---*>>
  36. <<#include 'GENSAY.INC'#>>   <<*To generate @row,col SAY,etc.*>>
  37. <<#include 'GENSTR.INC'#>>   <<*General string functions*>>
  38. <<#include 'GENVARS.INC'#>>  <<*Contains fixfldnam,GenMemVars,etc.*>>
  39. <<#include 'GENFILE.INC'#>>  <<*Contains GenHeader,GenFooter,etc.*>>
  40. <<#include 'GENCOLOR.INC'#>> <<*Contains GenColor,etc.*>>
  41. <<*---Application---*>>
  42. <<#include 'SSBFILE.INC'#>>  <<*General routines used by others*>>
  43. <<#include 'SSBPRIV.INC'#>>  <<*Special routines for APPE/EDIT*>>
  44. <<#include 'SSBOPEN.INC'#>>
  45. <<#include 'SSBMENU.INC'#>>
  46. <<#include 'SSBAPPE.INC'#>>
  47. <<#include 'SSBUPDA.INC'#>>
  48. <<#pragma
  49.  
  50. procedure GenPrograms
  51. string  fspec,filename
  52. begin
  53.  
  54.    fspec := fileprefix + 'O.PRG'
  55.    genln( ' ' )
  56.    genln( 'PROCEDURE ',fspec )
  57.    GenSBOpenBody
  58.    GenFooter( fspec )
  59.  
  60.    if (FuncStatus1 = 'T') or (FuncStatus1 = 't')
  61.       fspec := fileprefix + '1.PRG'
  62.       genln( ' ' )
  63.       genln( 'PROCEDURE ',fspec )
  64.       GenSBAppendBody
  65.       GenFooter( fspec )
  66.    endif
  67.  
  68.    if (FuncStatus2 = 'T') or (FuncStatus2 = 't')
  69.       fspec := fileprefix + '2.PRG'
  70.       genln( ' ' )
  71.       genln( 'PROCEDURE ',fspec )
  72.       GenSBUpdataBody
  73.       GenFooter( fspec )
  74.    endif
  75.  
  76. end <<*GenPrograms*>>
  77.  
  78.  
  79. procedure InitVariables
  80. begin
  81.   select databases 1
  82. <<* --- Function status --- *>>
  83.   FuncStatus1 := substr( dbfusr,1,1 )
  84.   FuncStatus2 := substr( dbfusr,2,1 )
  85.  
  86.   SCREENWIDTH := 0
  87.   fldprefix := 'm'   <<*FIELD_NAME prefix when using memvars*>>
  88.   <<*---Init Product logical vars---*>>
  89.   Fox     := (ProductCode = 1)
  90.   select all
  91.   ismultipage := (pagtotal > 1)
  92.   ismultials := (dbftotal > 1)
  93.   ismultindx := false
  94.   forall databases
  95.     if ndxtotal > 1
  96.       ismultindx := true
  97.     endif
  98.   endfor
  99.   featlabel := 2
  100.   filespec( prgname,fpath,fname,fext )
  101.   fileprefix := substr( fname,1,7 )
  102. end <<*InitVariables*>>
  103.  
  104.  
  105. begin <<*MAIN*>>
  106.   prgname := Table
  107.   if prgname
  108.      InitVariables
  109.      GenPrograms
  110.   endif
  111. end
  112.  
  113. <<*EOF: SSB02.GEN*>>
  114. #>>
  115.