DIWE5 ;SFISC/GFT-WP, AUX FUNCTIONS ;10/28/96 14:54
;;22.0;VA FileMan;;Mar 30, 1999
;Per VHA Directive 10-93-142, this routine should not be modified.
;
LNQ ;
W !,"ANSWER WITH A LINE NUMBER ("_(I'=6)_$P("-"_DWLC,U,DWLC>1)_")"
I $D(DWL) W !?9,"OR A SPACE TO MEAN THE CURRENT LINE ("_DWL_")" W:DWL>2 !?9,"OR '-' TO MEAN LINE ",DWL-1,", '-2' TO MEAN ",DWL-2,", ",$P("'+' TO MEAN "_(DWL+1)_", ",U,DWL<DWLC)_"ETC."
W ! Q
;
WL W !,"INITIALS:",! S X=$P(DIC,"(",1) Q:$D(@X)<9 S X=$O(@(X_"(0)"))-1,I=0 F S X=$O(^(X)) Q:X="" W X,!
S X=-1 Q
NL W !,"TEXT NAMES:",! S %T2="",I=0 F S %T2=$O(@(DW_")")) Q:%T2="" W %T2,?20,^(%T2,0),!
K %T2 Q
;
F ;
W !!,"Line WIDTH: "_DWLW_"//" R X:DTIME S DWLW=$S(X<10:DWLW,X>255:DWLW,1:X\1)
W !,"PACK "_$S(DWPK:"ON",1:"OFF")_"//" R X:DTIME S DWPK=$S(X="ON":1,1:0)
Q
X D ASK^DIWE11 Q:X="" S DIWL=X,(%,%B)="" X ^%ZOSF("EOFF")
ENT I '$D(DIWL) S DIWL=245
A R X#245:30 E I '$L(X) D S:$L(%B) G XQ^DIWE11
S:X="" X=" " I X?.ANP S Y=X G D
S I=0,Y=""
C S I=I+1 I $E(X,I,999)?.ANP S Y=Y_$E(X,I,999) G D
S %=$E(X,I),%0=$A(%)
I %?1C S %="" I %0=9 S %=$E(" ",1,9-($L(Y)-($L(Y)\9*9)))
S Y=Y_% D S:$L(Y)>DIWL I ":27:13:"[(":"_%0_":") D S
G C
D D S G D:$L(Y)'<DIWL S %B=Y,Y="" G A
S S:$L(%B) %B=%B_$S($E(Y)=" ":"",1:" ") S %=%B_Y,%2=$L(%) Q:'%2 S Y=""
I %2>DIWL F %1=DIWL:-1 I %1<$S(DIWL-12>0:DIWL-12,1:4)!(" -"[$E(%,%1)) S Y=$E(%,%1+1+$S($E(%,%1+1)=" ":1,1:0),999),%=$E(%,1,%1-$S($E(%,%1)=" ":1,1:0)) Q
S %B="",DWLC=DWLC+1,@(DIC_"DWLC,0)")=%
Q
TQ ;
W !?4,"IF YOU WANT TO USE TEXT FROM THE '"_J_"' FIELD",!?4,"OF ANOTHER '"
W I,"' ENTRY, TYPE THE NAME OF THAT ENTRY",!?4,"OTHERWISE, "
W "USE A COMPUTED-FIELD EXPRESSION TO DESIGNATE SOME W-P TEXT",!
G Z^DIWE3
;
IQ ;
I $D(DC) W:$D(^DD(+$P(DC,U,2),.01,3)) !?4,^(3),! X:$D(^(4)) ^(4) F %=0:0 S %=$O(^DD(+$P(DC,U,2),.01,21,%)) Q:%'>0 W !,^(%,0)
W !!,"You are ready to enter a line of text.",!,"If you have no text to enter,just ",$S(DIWPT="":"press the return key.",1:"type in """_DIWPT_"""."),!
W "Type 'CONTROL-I' (or TAB key) to insert tabs.",!
W "When text is output, these formatting rules will apply:"
W !," A) Lines containing only punctuation characters, or lines containing tabs",!?5,"will stand by themselves, i.e., no wrap-around."
W !," B) Lines beginning with spaces will start on a new line."
W !," C) Expressions between '|' characters will be evaluated as"
W !?5,"'computed-field expressions and then be printed as evaluated"
W !?5,"thus '|NAME|' would cause the current name to be inserted in the text."
W !!,$C(7),"Want to see a list of allowable formatting 'WINDOWS'" S %=2 D YN^DICN Q:%-1
W !?5,"SPECIAL FORMATTING INCLUDES: "
FN S %=15 F S %=$O(^DD("FUNC",%)) Q:%>97 I $D(^(%,10)) W !," |"_$P(^(0),U,1)_$P("(ARGUMENT)",U,$S('$D(^(3)):1,1:^(3)'=0))_"|",?25 W:$D(^(9)) ^(9)
DIWE5 ;SFISC/GFT-WP, AUX FUNCTIONS ;10/28/96 14:54
+1 ;;22.0;VA FileMan;;Mar 30, 1999
+2 ;Per VHA Directive 10-93-142, this routine should not be modified.
+3 ;
LNQ ;
+1 WRITE !,"ANSWER WITH A LINE NUMBER ("_(I'=6)_$PIECE("-"_DWLC,U,DWLC>1)_")"
+2 IF $DATA(DWL)
WRITE !?9,"OR A SPACE TO MEAN THE CURRENT LINE ("_DWL_")"
IF DWL>2
WRITE !?9,"OR '-' TO MEAN LINE ",DWL-1,", '-2' TO MEAN ",DWL-2,", ",$PIECE("'+' TO MEAN "_(DWL+1)_", ",U,DWL<DWLC)_"ETC."
+3 WRITE !
QUIT
+4 ;
WL WRITE !,"INITIALS:",!
SET X=$PIECE(DIC,"(",1)
IF $DATA(@X)<9
QUIT
SET X=$ORDER(@(X_"(0)"))-1
SET I=0
FOR
SET X=$ORDER(^(X))
IF X=""
QUIT
WRITE X,!
+1 SET X=-1
QUIT
NL WRITE !,"TEXT NAMES:",!
SET %T2=""
SET I=0
FOR
SET %T2=$ORDER(@(DW_")"))
IF %T2=""
QUIT
WRITE %T2,?20,^(%T2,0),!
+1 KILL %T2
QUIT
+2 ;
F ;
+1 WRITE !!,"Line WIDTH: "_DWLW_"//"
READ X:DTIME
SET DWLW=$SELECT(X<10:DWLW,X>255:DWLW,1:X\1)
+2 WRITE !,"PACK "_$SELECT(DWPK:"ON",1:"OFF")_"//"
READ X:DTIME
SET DWPK=$SELECT(X="ON":1,1:0)
+3 QUIT
X DO ASK^DIWE11
IF X=""
QUIT
SET DIWL=X
SET (%,%B)=""
XECUTE ^%ZOSF("EOFF")
ENT IF '$DATA(DIWL)
SET DIWL=245
A READ X#245:30
IF '$TEST
IF '$LENGTH(X)
IF $LENGTH(%B)
DO S
GOTO XQ^DIWE11
+1 IF X=""
SET X=" "
IF X?.ANP
SET Y=X
GOTO D
+2 SET I=0
SET Y=""
C SET I=I+1
IF $EXTRACT(X,I,999)?.ANP
SET Y=Y_$EXTRACT(X,I,999)
GOTO D
+1 SET %=$EXTRACT(X,I)
SET %0=$ASCII(%)
+2 IF %?1C
SET %=""
IF %0=9
SET %=$EXTRACT(" ",1,9-($LENGTH(Y)-($LENGTH(Y)\9*9)))
+3 SET Y=Y_%
IF $LENGTH(Y)>DIWL
DO S
IF ":27:13:"[(":"_%0_":")
DO S
+4 GOTO C
D DO S
IF $LENGTH(Y)'<DIWL
GOTO D
SET %B=Y
SET Y=""
GOTO A
S IF $LENGTH(%B)
SET %B=%B_$SELECT($EXTRACT(Y)=" ":"",1:" ")
SET %=%B_Y
SET %2=$LENGTH(%)
IF '%2
QUIT
SET Y=""
+1 IF %2>DIWL
FOR %1=DIWL:-1
IF %1<$SELECT(DIWL-12>0:DIWL-12,1:4)!(" -"[$EXTRACT(%,%1))
SET Y=$EXTRACT(%,%1+1+$SELECT($EXTRACT(%,%1+1)=" ":1,1:0),999)
SET %=$EXTRACT(%,1,%1-$SELECT($EXTRACT(%,%1)=" ":1,1:0))
QUIT
+2 SET %B=""
SET DWLC=DWLC+1
SET @(DIC_"DWLC,0)")=%
+3 QUIT
TQ ;
+1 WRITE !?4,"IF YOU WANT TO USE TEXT FROM THE '"_J_"' FIELD",!?4,"OF ANOTHER '"
+2 WRITE I,"' ENTRY, TYPE THE NAME OF THAT ENTRY",!?4,"OTHERWISE, "
+3 WRITE "USE A COMPUTED-FIELD EXPRESSION TO DESIGNATE SOME W-P TEXT",!
+4 GOTO Z^DIWE3
+5 ;
IQ ;
+1 IF $DATA(DC)
IF $DATA(^DD(+$PIECE(DC,U,2),.01,3))
WRITE !?4,^(3),!
IF $DATA(^(4))
XECUTE ^(4)
FOR %=0:0
SET %=$ORDER(^DD(+$PIECE(DC,U,2),.01,21,%))
IF %'>0
QUIT
WRITE !,^(%,0)
+2 WRITE !!,"You are ready to enter a line of text.",!,"If you have no text to enter,just ",$SELECT(DIWPT="":"press the return key.",1:"type in """_DIWPT_"""."),!
+3 WRITE "Type 'CONTROL-I' (or TAB key) to insert tabs.",!
+4 WRITE "When text is output, these formatting rules will apply:"
+5 WRITE !," A) Lines containing only punctuation characters, or lines containing tabs",!?5,"will stand by themselves, i.e., no wrap-around."
+6 WRITE !," B) Lines beginning with spaces will start on a new line."
+7 WRITE !," C) Expressions between '|' characters will be evaluated as"
+8 WRITE !?5,"'computed-field expressions and then be printed as evaluated"
+9 WRITE !?5,"thus '|NAME|' would cause the current name to be inserted in the text."
+10 WRITE !!,$CHAR(7),"Want to see a list of allowable formatting 'WINDOWS'"
SET %=2
DO YN^DICN
IF %-1
QUIT
+11 WRITE !?5,"SPECIAL FORMATTING INCLUDES: "
FN SET %=15
FOR
SET %=$ORDER(^DD("FUNC",%))
IF %>97
QUIT
IF $DATA(^(%,10))
WRITE !," |"_$PIECE(^(0),U,1)_$PIECE("(ARGUMENT)",U,$SELECT('$DATA(^(3)):1,1:^(3)'=0))_"|",?25
IF $DATA(^(9))
WRITE ^(9)