source: FOIAVistA/trunk/r/TOOLKIT-AWCM-XD-XIN-XPAR-XQAB-XT-XUC-XUR-ZIN-ZTED/XTEDTVXD.m@ 1671

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

initial load of FOIAVistA 6/30/08 version

File size: 2.8 KB
Line 
1XTEDTVXD ;SF/RWF - Call VMS EDT editor for a WP field. ;03/23/2004 10:38
2 ;;7.3;TOOLKIT;**11,70**;Apr 25, 1995
3A ;
4DSM ;Entry point for DSM on VMS
5 S:$D(IO)[0 IO=$I Q:^%ZOSF("OS")'["VAX"
6 N FN,I,C,F,X
7 D DPUT X "S X=$ZC(%EDT,FN)" D DGET
8 Q
9DPUT ;DSM, Put current data in VMS file
10 S FN="DIWE$"_$J_".TMP" X "C FN O FN:(NEWVERSION:PROT=(W=RWD))"
11 U FN X "F I=0:0 S I=$O("_DIC_"I)) Q:I'>0 W ^(I,0),!"
12 C FN
13 Q
14DGET ;DSM, Get data from VMS file, Expand tab, Strip control.
15 N $ES,$ET,%A S $ET="G DERR^XTEDTVXD"
16 X "O FN:(READONLY:DELETE)" K @($E(DIC,1,$L(DIC)-1)_")")
17 S C=$$CTRL
18 U FN F I=1:1 R X#255:60 D SAVE(I,X) Q:$ZA=-1
19DERR U IO S DWLC=I-1,$EC="" X "C FN O FN C FN:DELETE" ;Clean-up both copies
20 Q
21 ;
22CTRL() ;Return control char to remove
23 ;9 is missing, handle TAB special.
24 Q $C(1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31)
25 ;
26SAVE(I,V) ;Save one line
27 S:V[$C(9) V=$$TAB(V) S @(DIC_"I,0)")=$TR(V,C)
28 Q
29 ;
30TAB(S) ;Expand tabs
31 N F
32 S F=0 F S F=$F(S,$C(9),F) Q:(F'>0)!($L(S)+8>255) S S=$E(S,1,F-2)_$J("",8-(F-1#8))_$E(S,F,999)
33 Q S
34 ;
35TPU ;DSM, Call VMS TPU editor.
36 S:$D(IO)[0 IO=$I Q:^%ZOSF("OS")'["VAX"
37 N FN,I,C,F,X
38 D DPUT S X="TPU "_FN X "S X=$ZC(%TPU,X)" D DGET
39 Q
40 ;
41GTMVMS ;Entry point for GT.M on VMS
42 N FN,I,C,F,X
43 S:$D(IO)[0 IO=$I S X=^%ZOSF("OS") Q:X'["GT.M"
44 S FN="DIWE$"_$J_".TMP"
45 D GPUT S X="ZSYSTEM ""EDIT "_FN_"""" X X D GGET
46 I $L($ZSEARCH(FN)) ZSYSTEM "DEL "_FN_";*"
47 Q
48 ;
49GPUT ;GTM, Put current data in VMS file
50 X "C FN O FN:(NEWVERSION:NOREADONLY:VARIABLE)"
51 U FN X "F I=0:0 S I=$O("_DIC_"I)) Q:I'>0 W ^(I,0),!"
52 C FN
53 Q
54GGET ;GTM, Get data from VMS file, Expand tab, Strip control.
55 N $ES,$ET,%A S $ET="G GERR^XTEDTVXD"
56 S C=$$CTRL
57 X "O FN:(READONLY)" K @($E(DIC,1,$L(DIC)-1)_")")
58 U FN F I=1:1 R X#255:60 D SAVE(I,X) Q:$ZEOF
59GERR U IO S DWLC=I-1,$EC="" X "C FN O FN C FN:DELETE" ;Clean-up both copies
60 Q
61 ;
62GTMUNIX ;Entry point for GT.M on Unix
63 N FN,I,C,F,X
64 S:$D(IO)[0 IO=$I S X=^%ZOSF("OS") Q:X'["GT.M"
65 S FN="DIWE$"_$J_".TMP"
66 D GPUT X "ZSYSTEM ""vi """_FN D GGET
67 I $L($ZSEARCH(FN)) X "ZSYSTEM ""rm """_FN
68 Q
69 ;
70CACHE ;Entry point for Cache/VMS
71 N FN,OD,I,C,F,X
72 Q:^%ZOSF("OS")'["OpenM"
73 S:$D(IO)[0 IO=$I
74 S X=$$DEFDIR^%ZISH(""),OD=$ZU(168,X) ;Set working directory to default
75 D CPUT X "S X=$ZF(-1,""EDIT ""_FN)" D CGET
76 I $L($ZSEARCH(FN)) X "S X=$ZF(-1,""DEL ""_FN_"";*"")"
77 S X=$ZU(168,OD) ;Change back
78 Q
79 ;
80CPUT ;Cache, Put current data in VMS file
81 S FN="DIWE$"_$J_".TMP" X "O FN:(""NWS"")"
82 U FN X "F I=0:0 S I=$O("_DIC_"I)) Q:I'>0 W ^(I,0),!"
83 C FN
84 Q
85 ;
86CGET ;Cache, Get data from VMS file, Expand tab, Strip control.
87 N $ES,$ET,%A,% S $ET="G CERR^XTEDTVXD"
88 S C=$$CTRL
89 X "O FN:(""RV"")" S %A=$ZUTIL(68,40),%=$ZUTIL(68,40,1) ;Use $ZEOF
90 K @($E(DIC,1,$L(DIC)-1)_")")
91 U FN F I=1:1 Q:$ZEOF<0 R X#255:60 D SAVE(I,X)
92CERR U IO S DWLC=I-1,$EC="",%=$ZUTIL(68,40,%A)
93 X "C FN:""D"" O FN::1 I $T C FN:""D""" ;Clean-up both copies
94 Q
Note: See TracBrowser for help on using the repository browser.