source: FOIAVistA/trunk/r/VA_FILEMAN-ARJT-DI-DD-DM-DT-%DT-%RCR/DDBRZIS.m@ 677

Last change on this file since 677 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1DDBRZIS ;SFISC/DCL-BROWSER DEVICE UTILITIES ;4:50 AM 9 Apr 2006
2 ;;22.0;VA FileMan;**145,148**;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4OPEN ;
5 ;DDBRZIS AND DDBDMSG ARE KILLED IN POST
6 S DDBRZIS=1,DDBDMSG=$G(DDBDMSG)
7 U IO(0)
8 I $G(DDBDMSG)="" D Q:DDBDMSG="$$DTOUT$$"
9 .N DIR,X,Y
10 .S DIR(0)="FUO^0:78",DIR("A")="BROWSER TITLE (optional)"
11 .S DIR("B")="VA FileMan Browser"
12 .S DIR("?")="Enter any free text, which will appear in the Title Bar"
13 .D ^DIR
14 .I $G(DTOUT) S DDBDMSG="$$DTOUT$$" K DTOUT,DUOUT,DIRUT,DIROUT Q
15 .S DDBDMSG=$S(Y="":DDBDMSG,1:Y)
16 .Q
17 W !,"...one moment..."
18 U IO
19 Q:DDBDMSG]""
20 I $G(DHD)="W """" D ^DIDH" S DDBDMSG="DATA DICTIONARY" Q
21 S DDBDMSG="VA FileMan Browser"
22 Q
23 ;
24CLOSE ;
25 Q:$G(DDBDMSG)="$$DTOUT$$"
26 S DDBRZIS=$G(DDBRZIS,1)
27 N C,CHAR,DDBROS,EOF,X
28 K ^TMP("DDB",$J)
29 S DDBROS=^%ZOSF("OS"),EOF="EOF-End Of File"
30 S CHAR="" F I=1:1:31 S CHAR=CHAR_$C(I)
31 U IO W !,EOF,!
32 S DDBRZIS("REWIND")=$$REWIND^%ZIS(IO,IOT,IOPAR)
33 I 'DDBRZIS("REWIND") S DDBRZIS=0 U IO(0) W $C(7),!!?5,"<< UNABLE TO REWIND FILE>>",! H 3 Q
34 U IO
35 S C=0
36 F R X:2 Q:X="EOF-End Of File" D
37 .S X=$TR(X,CHAR)
38 .S:X']"" X=" "
39 .S C=C+1,^TMP("DDB",$J,C)=$E(X,1,255) Q
40 .Q
41 Q
42 ;
43POST ;
44 I $G(DDBDMSG)="$$DTOUT$$" K DDBDMSG,DDBRZIS W $C(7) Q
45 I $G(DDBRZIS) D BROWSE^DDBR("^TMP(""DDB"",$J)","NR",$G(DDBDMSG))
46 ; *148* Moved to POST-CLOSE EXECUTE of BROWSER device
47 ;I ^%ZOSF("OS")["OpenM",$G(IO("CLOSE"))]"" S DDBRZIS=$ZF(-1,"del "_ IO("CLOSE")_";*")
48 K DDBRZIS,DDBDMSG
49 Q
50 ;
51DEVICE(MSG) ;TEST IF BROWSER IS BEING INVOKED VIA DEVICE HANDLER
52 ;EXTRINSIC FUNCTION
53 I $D(DDBRZIS)#2,$G(MSG)]"" S DDBDMSG=MSG Q 1
54 Q 0
55 ;
56MSG(TXT) ;PASS TEXT FOR BROWSER TITLE WHEN BROWSER INVOKED VIA DEVICE HANDLER
57 ;PROCEDURE CALL
58 S DDBDMSG=$G(TXT)
59 Q
60STR(X) ; Remove windows
61 N I,Y
62 I $L(X,"|")'>2 Q X
63 I X["|WRAP|"!(X["| NO WRAP|")!(X["|NOWRAP|") S Y="" F I=1:1:$L(X,"|") S:(I#2) Y=Y_$P(X,"|",I)
64 Q $S(X'["|":X,1:$G(Y))
Note: See TracBrowser for help on using the repository browser.