XUTMTEIO ;SEA/RDS - TaskMan: Toolkit, Edit I/O Device ; ;
;;8.0;KERNEL;;Jul 10, 1995
;
ASK ;determine whether task should have an io device
S DIR(0)="YO"
S DIR("A")="Do you wish to requeue this task to a device"
S DIR("B")=$S($P(ZTSK(2),U)="":"NO",1:"YES")
S DIR("?")="^D HELP^XUTMTEIO"
S DIR("??")="^D HELP2^ZTMEIO"
D ^DIR
I $D(DTOUT) W $C(7)
I $D(DIRUT) Q
I 'Y S ZTSK(2)="",ZTSK(25)="" Q
S XUTMUCI="",ZTCPU="",ZTIO=""
;
EDIT ;edit task's io device
S %ZIS="NZ"
S %ZIS("A")="IO DEVICE: "
S %ZIS("B")=$S($P(ZTSK(2),U)]"":$P(ZTSK(2),U),1:"")
D ^%ZIS
S ZTIO=$S($D(IOS)[0:"",POP:"",$D(ION)[0:"",ION]"":ION,IOS="":"",$D(^%ZIS(1,IOS,0))[0:"",1:$P(^(0),U))
I ZTIO="" S DIRUT=1 Q
I IOT="VTRM" D HOME^%ZIS W !,"Tasks can not open virtual terminals.",$C(7),! G EDIT
S $P(ZTSK(2),U)=ZTIO_$S($D(IOST)[0:"",1:";"_IOST)_$S($D(IO("DOC"))[0:$S($D(IOM)[0:"",1:";"_IOM_$S($D(IOSL)[0:"",1:";"_IOSL)),1:";"_IO("DOC"))
S $P(ZTSK(2),U,6)="",ZTSK(25)=""
I $D(IO("HFSIO"))#2 S $P(ZTSK(2),U,6)=IO("HFSIO")
I $D(IOPAR)#2 S ZTSK(25)=IOPAR
I $D(IOCPU)#2 S ZTCPU=IOCPU
I ZTCPU]"",$P(ZTSK(0),U,14)]"",ZTCPU'=$P(ZTSK(0),U,14) S X=$P(XUTMUCI,","),Y=$O(^%ZIS(14.6,"AT",X,$P(ZTSK(0),U,14),ZTCPU,"")) S:Y="" Y=X S XUTMUCI=Y_","_ZTCPU
;
HELP ;EDIT--?-help for first prompt
W !!?5,"Answer must be YES or NO."
Q
;
HELP2 ;EDIT--??-help for first prompt
W !!?5,"Answer whether this task requires an io device."
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXUTMTEIO 1446 printed Nov 22, 2024@17:23:54 Page 2
XUTMTEIO ;SEA/RDS - TaskMan: Toolkit, Edit I/O Device ; ;
+1 ;;8.0;KERNEL;;Jul 10, 1995
+2 ;
ASK ;determine whether task should have an io device
+1 SET DIR(0)="YO"
+2 SET DIR("A")="Do you wish to requeue this task to a device"
+3 SET DIR("B")=$SELECT($PIECE(ZTSK(2),U)="":"NO",1:"YES")
+4 SET DIR("?")="^D HELP^XUTMTEIO"
+5 SET DIR("??")="^D HELP2^ZTMEIO"
+6 DO ^DIR
+7 IF $DATA(DTOUT)
WRITE $CHAR(7)
+8 IF $DATA(DIRUT)
QUIT
+9 IF 'Y
SET ZTSK(2)=""
SET ZTSK(25)=""
QUIT
+10 SET XUTMUCI=""
SET ZTCPU=""
SET ZTIO=""
+11 ;
EDIT ;edit task's io device
+1 SET %ZIS="NZ"
+2 SET %ZIS("A")="IO DEVICE: "
+3 SET %ZIS("B")=$SELECT($PIECE(ZTSK(2),U)]"":$PIECE(ZTSK(2),U),1:"")
+4 DO ^%ZIS
+5 SET ZTIO=$SELECT($DATA(IOS)[0:"",POP:"",$DATA(ION)[0:"",ION]"":ION,IOS="":"",$DATA(^%ZIS(1,IOS,0))[0:"",1:$PIECE(^(0),U))
+6 IF ZTIO=""
SET DIRUT=1
QUIT
+7 IF IOT="VTRM"
DO HOME^%ZIS
WRITE !,"Tasks can not open virtual terminals.",$CHAR(7),!
GOTO EDIT
+8 SET $PIECE(ZTSK(2),U)=ZTIO_$SELECT($DATA(IOST)[0:"",1:";"_IOST)_$SELECT($DATA(IO("DOC"))[0:$SELECT($DATA(IOM)[0:"",1:";"_IOM_$SELECT($DATA(IOSL)[0:"",1:";"_IOSL)),1:";"_IO("DOC"))
+9 SET $PIECE(ZTSK(2),U,6)=""
SET ZTSK(25)=""
+10 IF $DATA(IO("HFSIO"))#2
SET $PIECE(ZTSK(2),U,6)=IO("HFSIO")
+11 IF $DATA(IOPAR)#2
SET ZTSK(25)=IOPAR
+12 IF $DATA(IOCPU)#2
SET ZTCPU=IOCPU
+13 IF ZTCPU]""
IF $PIECE(ZTSK(0),U,14)]""
IF ZTCPU'=$PIECE(ZTSK(0),U,14)
SET X=$PIECE(XUTMUCI,",")
SET Y=$ORDER(^%ZIS(14.6,"AT",X,$PIECE(ZTSK(0),U,14),ZTCPU,""))
if Y=""
SET Y=X
SET XUTMUCI=Y_","_ZTCPU
+14 ;
HELP ;EDIT--?-help for first prompt
+1 WRITE !!?5,"Answer must be YES or NO."
+2 QUIT
+3 ;
HELP2 ;EDIT--??-help for first prompt
+1 WRITE !!?5,"Answer whether this task requires an io device."
+2 QUIT
+3 ;