DGMTSCU1 ;ALB/RMO/CAW - Means Test Screen Display Utilities ;21 JAN 1992 8:00 pm
;;5.3;Registration;**166**;Aug 13, 1993
;
YN(X) ;Output Yes/No
; Input -- X 1, 0 or ""
; Output -- YES, NO or UNANSWERED
N Y
S Y=$S(X:"YES",X="":"UNANSWERED",1:"NO")
Q $G(Y)
;
AMT(X) ;Output Dollar Amount
; Input -- X Amount
; Output -- Dollar amount
N Y
I X]"" S $P(X,".",2)=$E($P(X,".",2)_"00",1,2)
S Y=$S(X]"":"$"_X,1:"-")
Q $G(Y)
;
DATE(X) ;Output Date
; Input -- X Date
; Output -- Date
N Y
S Y=$$FMTE^XLFDT(X,"5DF") I Y]"" S Y=$TR(Y," ","0")
Q $G(Y)
;
LYR(X) ;Last Year
; Input -- X Date
; Output -- Last Year
N Y
S Y=$E(X,1,3)-1_"0000"
Q $G(Y)
;
TOT(X,R1,R2) ;Compute Total
; Input -- X String to total
; R1 Beginning of range
; R2 End of Range
; Output -- Total
N I,Y
S Y=0 F I=R1:1:R2 S Y=Y+$P(X,"^",I)
Q $G(Y)
;
UL(X,L) ;Underline
; Input -- X Underline Character
; Output -- Underline String
W ?131,$C(13) W:X["-" !
Q $G(L)
;
HIGH(Z,ACT) ; Highlight certain text
; Input -- Z Character(s) to highlight
; ACT MT action
; Ouput -- Hightlighted character
W ! S Z=$S(ACT="VEW":"<"_Z_">",1:"["_Z_"]")
I ACT="VEW" W Z Q
I ACT'="VEW"!($E(Z)="[") W DGVI,Z,DGVO
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGMTSCU1 1364 printed Oct 16, 2024@18:46:06 Page 2
DGMTSCU1 ;ALB/RMO/CAW - Means Test Screen Display Utilities ;21 JAN 1992 8:00 pm
+1 ;;5.3;Registration;**166**;Aug 13, 1993
+2 ;
YN(X) ;Output Yes/No
+1 ; Input -- X 1, 0 or ""
+2 ; Output -- YES, NO or UNANSWERED
+3 NEW Y
+4 SET Y=$SELECT(X:"YES",X="":"UNANSWERED",1:"NO")
+5 QUIT $GET(Y)
+6 ;
AMT(X) ;Output Dollar Amount
+1 ; Input -- X Amount
+2 ; Output -- Dollar amount
+3 NEW Y
+4 IF X]""
SET $PIECE(X,".",2)=$EXTRACT($PIECE(X,".",2)_"00",1,2)
+5 SET Y=$SELECT(X]"":"$"_X,1:"-")
+6 QUIT $GET(Y)
+7 ;
DATE(X) ;Output Date
+1 ; Input -- X Date
+2 ; Output -- Date
+3 NEW Y
+4 SET Y=$$FMTE^XLFDT(X,"5DF")
IF Y]""
SET Y=$TRANSLATE(Y," ","0")
+5 QUIT $GET(Y)
+6 ;
LYR(X) ;Last Year
+1 ; Input -- X Date
+2 ; Output -- Last Year
+3 NEW Y
+4 SET Y=$EXTRACT(X,1,3)-1_"0000"
+5 QUIT $GET(Y)
+6 ;
TOT(X,R1,R2) ;Compute Total
+1 ; Input -- X String to total
+2 ; R1 Beginning of range
+3 ; R2 End of Range
+4 ; Output -- Total
+5 NEW I,Y
+6 SET Y=0
FOR I=R1:1:R2
SET Y=Y+$PIECE(X,"^",I)
+7 QUIT $GET(Y)
+8 ;
UL(X,L) ;Underline
+1 ; Input -- X Underline Character
+2 ; Output -- Underline String
+3 WRITE ?131,$CHAR(13)
if X["-"
WRITE !
+4 QUIT $GET(L)
+5 ;
HIGH(Z,ACT) ; Highlight certain text
+1 ; Input -- Z Character(s) to highlight
+2 ; ACT MT action
+3 ; Ouput -- Hightlighted character
+4 WRITE !
SET Z=$SELECT(ACT="VEW":"<"_Z_">",1:"["_Z_"]")
+5 IF ACT="VEW"
WRITE Z
QUIT
+6 IF ACT'="VEW"!($EXTRACT(Z)="[")
WRITE DGVI,Z,DGVO
+7 QUIT