[613] | 1 | XTEDTVXD ;SF/RWF - Call VMS EDT editor for a WP field. ;03/23/2004 10:38
|
---|
| 2 | ;;7.3;TOOLKIT;**11,70**;Apr 25, 1995
|
---|
| 3 | A ;
|
---|
| 4 | DSM ;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
|
---|
| 9 | DPUT ;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
|
---|
| 14 | DGET ;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
|
---|
| 19 | DERR U IO S DWLC=I-1,$EC="" X "C FN O FN C FN:DELETE" ;Clean-up both copies
|
---|
| 20 | Q
|
---|
| 21 | ;
|
---|
| 22 | CTRL() ;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 | ;
|
---|
| 26 | SAVE(I,V) ;Save one line
|
---|
| 27 | S:V[$C(9) V=$$TAB(V) S @(DIC_"I,0)")=$TR(V,C)
|
---|
| 28 | Q
|
---|
| 29 | ;
|
---|
| 30 | TAB(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 | ;
|
---|
| 35 | TPU ;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 | ;
|
---|
| 41 | GTMVMS ;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 | ;
|
---|
| 49 | GPUT ;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
|
---|
| 54 | GGET ;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
|
---|
| 59 | GERR U IO S DWLC=I-1,$EC="" X "C FN O FN C FN:DELETE" ;Clean-up both copies
|
---|
| 60 | Q
|
---|
| 61 | ;
|
---|
| 62 | GTMUNIX ;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 | ;
|
---|
| 70 | CACHE ;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 | ;
|
---|
| 80 | CPUT ;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 | ;
|
---|
| 86 | CGET ;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)
|
---|
| 92 | CERR 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
|
---|