Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: INHUT4

INHUT4.m

Go to the documentation of this file.
  1. INHUT4 ;JAW,JPD; 13 Jan 93 14:16;HANDLE COPIES OF DOCUMENTS
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;
  1. COPIES(COPIES,PROMPT) ; ask # copies
  1. ; COPIES(op)=Default for number of copies; def=1
  1. ; PROMPT(op)=Alternate prompt; def="Number of Copes: "
  1. S COPIES=$S($G(COPIES):+COPIES,1:1),PROMPT=$S($G(PROMPT)]"":PROMPT,1:"NUMBER OF COPIES: ")_COPIES_"//"
  1. F D I %["^"!% Q
  1. .W !,PROMPT R %:DTIME E S %="^" Q
  1. .I %["^" S %="^" Q
  1. .I %="" S %=COPIES
  1. .I %<1!(%>10)!(%'?.N) W !,"Enter a number between 1 and 10" S %=0
  1. Q %
  1. PRINT(ROU,COPIES,DOC) ; Print multiple copies of a report to device 'IO'
  1. ;NOTE: DEVICE 'IO' MUST BE OPEN WHEN CALLING
  1. ; ROU(re) = Run routine to do printing
  1. ; COPIES(op) = # copies to print (def 1)
  1. ; DOC(op) = Name for document being printed. If passed doc is left
  1. ; with an expiration date of a week. Scratch name used &
  1. ; doc. deleted if not passed. DOC contains one copy of
  1. ; what is printed by 'ROU'.
  1. N DA,DIE,DR,INZISDA,INZISDOC,ZISDA,ZISDOC
  1. ; ZISDOC by ref. - need to know the document name from RUN
  1. S (ZISDOC,DOC)=$G(DOC) D RUN(ROU,.ZISDOC,IOM,IOSL)
  1. S ZISCOPY=$S($G(COPIES):COPIES,1:1)
  1. ; Save values; Print multiple copies; SPOOLER closes device
  1. S ZISDA=$O(^XUSPLDSM("B",ZISDOC,"")),ZISDOC=$G(^XUSPLDSM(ZISDA,1))
  1. S INZISDA=ZISDA,INZISDOC=ZISDOC U IO D ENTSK^%ZISPL
  1. ; Delete spool document and VMS file
  1. I DOC="" S DA=INZISDA,DIK="^XUSPLDSM(" D ^DIK
  1. Q
  1. RUN(ROU,DOC,IOM,IOSL) ; Print to spool file 'DOC' once
  1. ; ROU(re)=Routine that does printing
  1. ; DOC(op)=Document name (def bogus doc)
  1. ; IOM(op)=Margin for out (def 80)
  1. ; IOSL(op)=Pg length for out (def 60)
  1. N IO,IOP,IOST
  1. S DOC=$S($G(DOC)="":"INSPOOL"_$TR($H,",")_$J,1:DOC)
  1. S IOP="SPOOL;"_DOC_";"_$S($G(IOM):IOM,1:80)_";"_$S($G(IOSL):IOSL,1:60)
  1. D ^%ZIS D
  1. .; New DOC in case DOC was by ref. and 'ROU' kills it
  1. .N DOC U IO D @ROU,^%ZISC
  1. Q