home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / TM480.ZIP / TMMANUAL.EXE / PRINTMAN.TSK < prev    next >
Encoding:
Text File  |  1991-09-10  |  9.4 KB  |  377 lines

  1. ╗ Titlσ   ║ PRINTMAN.TS╦                Las⌠ UpdateΣ ║ Septembe≥ 6¼ 1991
  2. ; Author  : Steve Johnson - FmP.        Version      : 1.20
  3. ; Purpose : Selective On-line Taskmaster manual print facility
  4. ; Notes   : discards blank line 22 if present 
  5. ;         : Requires IBM Graphics printer emulation to print
  6. ;         : Form names were captured from SCR output into a file
  7. ;         : The data command understands ^x and sends a control
  8. ;         : character ^ has to be sent as ^^ 
  9. ; version 1.20
  10. ╗         ║ Caε no≈ translatσ ou⌠ 'non-printablσ characters'
  11. ; version 1.10
  12. ;         : Optional use of form feeds.
  13.  
  14. define pages,1
  15.  
  16. hexvar crlf,0d0a
  17. hexvar esc,1b
  18. hexvar line_23,c8cd
  19. hexvar vbar,ba
  20. hexva≥ unprin_table,18191b1a11
  21.  
  22. int count
  23. int line
  24. int lines_this_page
  25. int saftey
  26. int toapage
  27. int xcount
  28.  
  29. logical form_feeds
  30. logical suppress
  31. logical proceed
  32. logical last_was_spaces
  33. logical quit
  34. logical skip
  35. logical next_menu
  36. logica∞ no_translate
  37. logical partial
  38.  
  39. var formname,2
  40. var formindex,2,occurs 200,
  41. '1 2 X MGG1G2G3G4G5G6G7G8G9GAGBGCMHH1H2H3H4H5H6H7H8H9HA'
  42. 'HBHCHDI1I2I3I4MEE1E2E3E4E5E6E7E8E9EAEBECEDMFF1F2F3F4F5F6F7'
  43. 'F8F9FAFBFCFDFEFFFGFHFIM1111213141516M22122232425262728292A'
  44. '2B2CM3313233M44142434445464748494A4B4C4D4E4FM5515253M66162'
  45. '6364M771727374757677M88182M9919293949596979899MAA1A2A3A4A5'
  46. 'A6A7MBB1B2B3B4B5B6B7B8B9BAMCC1C2C3C4C5C6C7C8MDD1D2D3'
  47.  
  48. var act_space,12
  49. var min_space,12,'      262144'    ;disc space warning limit 256k
  50. var work_space,12,'        2500';disc space warning limit 2500bytes
  51.  
  52. var char,1
  53. var last_line,80
  54. èvar lines_per_page,2
  55. var name,8,'PRINTMAN'
  56. var null,1
  57. var s_line,90
  58. var screen,80,occurs24
  59. var space_line,80
  60. var spaces_78,78
  61. va≥ translations,1,occur≤ 5
  62. va≥ unprintable,1,occur≤ 5
  63.  
  64. vconst cls,11  ;Clear screen
  65. vconst attn,79
  66. vconst brite,41
  67.  
  68. end
  69.  
  70. combine vbar 78 vbar into space_line
  71. clear spaces_78
  72. forms logon.ovr
  73. lookfor printman.ovr
  74. if not found
  75.   insert name name
  76.   put "NO_FORMS"
  77.   stop
  78. fi
  79. movσ unprin_tablσ t∩ unprintable
  80. forms printman.ovr
  81. dspace
  82. move display to act_space
  83. if act_space < min_space
  84.   put space_warn
  85.   get proceed
  86.   if not proceed
  87.     stop
  88.   fi
  89. fi
  90. put manprint noclear
  91. if anyfk
  92.   stop
  93. fi
  94. get suppress lines_per_page form_feeds
  95. put graph
  96. iµ funke∙ ╜ 10
  97.   stop
  98. fi 
  99. movσ fk▓ t∩ no_translate
  100. if no⌠ fk2
  101.   unti∞ xcoun⌠ ╜ 6
  102.     get entr∙ xcoun⌠ oµ translations
  103.   fΘ xcount
  104.   clea≥ xcount
  105. fi
  106. move lines_per_page to saftey
  107. move lines_per_page to toapage
  108. subtract 24 from saftey
  109. lookfor tmman.ovr
  110. if not found
  111.   put 'NO_TMMAN'
  112.   stop
  113. fi
  114. forms tmman.ovr
  115. behave 3 'TMMAN.MAN'
  116. until count = 200
  117.   move entry count of formindex to formname
  118.   trim formname
  119.   inkey 
  120.   if key 
  121.     forms printman.ovr
  122.     put break-in
  123.     get char
  124.     forms tmman.ovr
  125.     upper char
  126.     if char = 'Y'
  127.       move true to quit
  128.       move true to partial
  129.     fi  
  130.   fi
  131.   if formname = null or quit
  132.     behave 0
  133.     display cls
  134.     cursor 12 25 'Your manual is called TMMAN.MAN'
  135.     cursor 13 25 'View with LIST? Answer Y or N '
  136.     inkey char
  137.     upper char 
  138.     if char = 'Y'
  139.       move true to hide
  140.       run 'LIST TMMAN.MAN'
  141.     fi
  142.     display cls
  143.     cursor 12 15 'Your manual is ready for printing in TMMAN.MAN'
  144.     if partial   
  145.       cursor 13 15 'Length ' pages ' pages (Extract only)'
  146.     else
  147.       cursor 13 15 'Length ' pages ' pages (Contains full listing)'
  148.     fi
  149.     stop
  150.   fi
  151.   clear skip
  152.   if formname sw 'M' or formname = '1 ' or formname sw 'X'
  153.     move 8000h to bbmask
  154.     put formname nodata noclear
  155.     userline brite attn 'Press <return> (or wait 5 seconds) to print this section, <esc> to skip'
  156.     wait 5
  157.     clear next_menu
  158.     if key and keyval = esc
  159.       move true to partial
  160. è      increment count
  161.       until next_menu or formname = null
  162.         move entry count of formindex to formname
  163.         trim formname
  164.         if formname sw 'M' or formname =  '1' or formname sw 'X'
  165.           move true to next_menu
  166.         fi
  167.       fi count
  168.       decrement count count
  169.       move true to skip
  170.     fi
  171.   else
  172.     put formname nowait 
  173.     userline brite attn 'Printing ' formname '... Press any key to break-in'  
  174.   fi
  175.   if not skip
  176.     clear line
  177.     until line = 24
  178.       clear s_line
  179.       scanvid line giving s_line 
  180.       move s_line to entry line of screen
  181.     fi line
  182.     clear line last_was_spaces
  183.     until line = 24
  184.       move entry line of screen to s_line
  185.       if s_line ct '^'
  186.         replace all '^' of s_line with '^^'
  187.       fi
  188.       iµ no⌠ no_translate
  189.         clea≥ xcount
  190.         unti∞ xcoun⌠ ╜ 5
  191.           if s_line ct entr∙ xcoun⌠ oµ unprintable
  192.             replacσ al∞ entr∙ xcoun⌠ oµ unprintablσ oµ s_linσ witΦ entr∙ xcoun⌠ oµ translations
  193.           fi
  194.         fΘ xcount
  195.       fi
  196.       if suppress
  197.         if line = 23
  198.           data s_line crlf
  199.           increment lines_this_page
  200.         else
  201.           if s_line ct spaces_78
  202.             move true to last_was_spaces
  203.           else
  204.             if last_was_spaces 
  205.               data space_line crlf
  206.               increment lines_this_page
  207.             fi
  208.             data s_line crlf
  209.             increment lines_this_page
  210.             clear last_was_spaces
  211.           fi
  212.         fi
  213.       else
  214.         data s_line crlf
  215. è        increment lines_this_page
  216.       fi
  217.     fi line
  218.     if lines_this_page > saftey
  219.       if form_feeds
  220.         data ^l crlf
  221.       else
  222.         until lines_this_page = toapage
  223.           data crlf
  224.         fi lines_this_page
  225.       fi
  226.       increment pages 
  227.       clear lines_this_page
  228.     fi
  229.     dspace
  230.     move display to act_space
  231.     if act_space < work_space
  232.       put 
  233.       move true to quit
  234.       move true to partial
  235.     fi
  236.   fi
  237. fi count
  238.  
  239. endtask
  240.  
  241.  
  242. @video
  243. @nf manprint
  244. @acceptfk f10
  245. @dim
  246. @logical
  247. @num min40,max99
  248. @logical
  249. @head left,PRINTMAN.TSK
  250. @head right,'Taskmaster (c) FmP 1991'
  251. @head centre,'Taskmaster Manual Extraction'
  252. @colour page,cyan,blue
  253. @banner
  254. @border
  255.  
  256.      This  task takes forms from TMMAN.OVR and displays them on  the  screen 
  257.      then  reads  the  screen and writes the  contents  to  TMMAN.MAN.   The 
  258.      output file is ~256k in size.  
  259.  
  260.      In order to save space consecutive blank lines can be supressed: 
  261.      Do you wish to suppress blank lines? [Y]
  262.  
  263.      The task paginates the output: 
  264.      How many lines do you want on each page? [66] 40-99
  265.      Use form feed characters to eject pages?  [N]
  266.  
  267.      The pagination is not very sophisticated and may throw pages in  places 
  268.      where  it doesn't need to.  It may be worth looking at the output  file 
  269.      with your wordprocessor (or the supplied utility LIST) before printing.   
  270. è
  271.      Please  note  that the printer will need to be able to  print  the  IBM 
  272.      graphics character set to print the file successfully.  
  273.  
  274. @translate
  275. @MAP #,9C
  276.      Please note that the documentation produced is not as comprehensive  or 
  277.      as readable as that in the printed manual which costs #20.
  278. @bright
  279. @use 'Press F10 to abandon'
  280. @end
  281. @nf no_tmman
  282. @colour char,white,red
  283. @dim
  284. @win line4,column20,depth16,width42
  285. @out white
  286.  PRINTMAN-Error:
  287.  PRINTMAN  requires access to  the  forms 
  288.  file for the on-line manual.  This  file 
  289.  is   called   TMMAN.OVR.   It   is   not 
  290.  currently   available.   The   file   is 
  291.  normally    created    either     during 
  292.  installation  or via  OVERVIEW.TSK  (you 
  293.  can  of course also create  it  manually 
  294.  with SCR).  
  295.  
  296.  To create the file from OVERVIEW  select 
  297.  TMMAN  from  the main menu,   this  will 
  298.  create   the   file   and   enter    the 
  299.  application.  You may then exit and  re-
  300.  run PRINTMAN.
  301. @end
  302. @nf break-in
  303. @logical
  304. @bright
  305. @colour char,white,red
  306. @window line10,column15,depth6,width21
  307. @drop
  308. @out cyan
  309.  PRINTMAN
  310.  Break-in detected. 
  311.  Abandon processing?
  312.  [N] enter Y or N  
  313.  and press 
  314. @col char,white,red
  315. @end
  316. @nf no-space
  317. @bright
  318. @colour char,white,red
  319. @window line10,column15,depth10,width21
  320. @drop
  321. @out cyan
  322.  PRINTMAN
  323.  I need more space. 
  324.  Unable to  proceed.
  325.  The amount of  free 
  326.  space  is now  less 
  327.  than  2500   bytes. 
  328. è Please  make   more 
  329.  space  and  re-run. 
  330.  Press any key...
  331. @col char,cyan,blue
  332. @end
  333. @nf space_warn
  334. @head centre,'Free Space'
  335. @log
  336. @colour page,cyan,blue
  337. @banner
  338. @border
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.              This task creates an output file of upto 256k in size.
  347.  
  348.                   Your logged drive has less space than this.  
  349.  
  350.                           Do you wish to proceed? [N] 
  351. @end
  352. @nf graph
  353. @acceptfδ esc,f2
  354. @head centre,'Graphic≤ characters'
  355. @colour page,cyan,blue
  356. @banner
  357. @border
  358. @strámin1
  359. @strámin1
  360. @strámin1
  361. @strámin1
  362. @strámin1
  363.  
  364. áááááThσ printou⌠ wil∞ contaiε somσ character≤ tha⌠ you≥ printe≥ ma∙ no⌠ ábσ ì
  365. áááááablσ t∩ easil∙ prin⌠ (notabl∙ ò ä û ù anΣ ⌐ fo≥ thi≤ reasoε yo⌡ ma∙ 
  366.      wisΦ át∩ usσ othe≥ character≤ t∩ represen⌠ these«  Pleasσ áspecif∙ áthσ ì
  367. ááááácharacter≤ t∩ bσ useΣ (elsσ pres≤ f▓ t∩ leavσ theφ a≤ the∙ are).
  368.  
  369. áááááfo≥ ò usσ [U▌ 
  370. áááááfo≥ ä usσ [D▌ 
  371. áááááfo≥  usσ [L▌ 
  372. áááááfo≥  usσ [R▌ 
  373. áááááfo≥  usσ [<▌ 
  374.  
  375.      Pres≤ ü t∩ translatσ a≤ pe≥ thσ entrie≤ above;
  376.      Pre≤≤ f▓ t∩ preven⌠ translation;
  377.      Pres≤ f1░ t∩ qui⌠ PRINTSCR 
  378.  
  379. áááááPleasσ  notσ  tha⌠ thσ printe≥ wil∞ neeΣ t∩ bσ ablσ t∩  prin⌠  thσ  IB═  ì
  380. ááááágraphic≤ characte≥ se⌠ t∩ prin⌠ thσ filσ successfully« 
  381. @end
  382. @eof
  383. è