VALM11 ;ALB/MJK - VALM Utilities ;02/01/2001 11:35
;;1.0;List Manager;**6**;Aug 13, 1993
RANGE ; -- change date range
; input: ^TMP("VALM DATA",$J VALMEVL,"DAYS") := number of days allowed
; VALMB := default beginning date {optional}
; output: VALMBEG,VALMEND := date range
N DIR,X,X1,X2,VALMX,VALMX1,%DT ; calling apps may expect DIRUT,Y
S (VALMBEG,VALMEND)=""
I $D(VALMB) S Y=VALMB D DD^%DT S:Y]"" %DT("B")=Y
W ! S:$D(VALMIN) %DT(0)=VALMIN S %DT="AEX",%DT("A")="Select Beginning Date: "
D ^%DT K %DT Q:Y<0
S (X1,VALMX)=Y,X2=+$G(^TMP("VALM DATA",$J,VALMEVL,"DAYS")) D C^%DTC S VALMX1=X,X=""
I VALMX'>DT,VALMX1>DT S X="TODAY"
I X="" S Y=VALMX D DD^%DT S X=Y
S DIR("A")="Select Ending Date: "
S DIR("B")=X
S DIR(0)="DA"_U_VALMX_":"_VALMX1_":EX"
S DIR("?",1)="Date range can be a maximum of "_+$G(^TMP("VALM DATA",$J,VALMEVL,"DAYS"))_" days long.",DIR("?",2)=" "
S DIR("?",3)="Enter a date between "_$$FMTE^XLFDT(VALMX)_" and "_$$FMTE^XLFDT(VALMX1)_".",DIR("?")=" "
D ^DIR Q:Y'>0
S VALMEND=Y,VALMBEG=VALMX
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVALM11 1068 printed Oct 16, 2024@18:10:48 Page 2
VALM11 ;ALB/MJK - VALM Utilities ;02/01/2001 11:35
+1 ;;1.0;List Manager;**6**;Aug 13, 1993
RANGE ; -- change date range
+1 ; input: ^TMP("VALM DATA",$J VALMEVL,"DAYS") := number of days allowed
+2 ; VALMB := default beginning date {optional}
+3 ; output: VALMBEG,VALMEND := date range
+4 ; calling apps may expect DIRUT,Y
NEW DIR,X,X1,X2,VALMX,VALMX1,%DT
+5 SET (VALMBEG,VALMEND)=""
+6 IF $DATA(VALMB)
SET Y=VALMB
DO DD^%DT
if Y]""
SET %DT("B")=Y
+7 WRITE !
if $DATA(VALMIN)
SET %DT(0)=VALMIN
SET %DT="AEX"
SET %DT("A")="Select Beginning Date: "
+8 DO ^%DT
KILL %DT
if Y<0
QUIT
+9 SET (X1,VALMX)=Y
SET X2=+$GET(^TMP("VALM DATA",$JOB,VALMEVL,"DAYS"))
DO C^%DTC
SET VALMX1=X
SET X=""
+10 IF VALMX'>DT
IF VALMX1>DT
SET X="TODAY"
+11 IF X=""
SET Y=VALMX
DO DD^%DT
SET X=Y
+12 SET DIR("A")="Select Ending Date: "
+13 SET DIR("B")=X
+14 SET DIR(0)="DA"_U_VALMX_":"_VALMX1_":EX"
+15 SET DIR("?",1)="Date range can be a maximum of "_+$GET(^TMP("VALM DATA",$JOB,VALMEVL,"DAYS"))_" days long."
SET DIR("?",2)=" "
+16 SET DIR("?",3)="Enter a date between "_$$FMTE^XLFDT(VALMX)_" and "_$$FMTE^XLFDT(VALMX1)_"."
SET DIR("?")=" "
+17 DO ^DIR
if Y'>0
QUIT
+18 SET VALMEND=Y
SET VALMBEG=VALMX
+19 QUIT