Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DIWE5

DIWE5.m

Go to the documentation of this file.
  1. DIWE5 ;SFISC/GFT-WP, AUX FUNCTIONS ;10/28/96 14:54
  1. ;;22.0;VA FileMan;;Mar 30, 1999
  1. ;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. LNQ ;
  1. W !,"ANSWER WITH A LINE NUMBER ("_(I'=6)_$P("-"_DWLC,U,DWLC>1)_")"
  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."
  1. W ! Q
  1. ;
  1. 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,!
  1. S X=-1 Q
  1. NL W !,"TEXT NAMES:",! S %T2="",I=0 F S %T2=$O(@(DW_")")) Q:%T2="" W %T2,?20,^(%T2,0),!
  1. K %T2 Q
  1. ;
  1. F ;
  1. W !!,"Line WIDTH: "_DWLW_"//" R X:DTIME S DWLW=$S(X<10:DWLW,X>255:DWLW,1:X\1)
  1. W !,"PACK "_$S(DWPK:"ON",1:"OFF")_"//" R X:DTIME S DWPK=$S(X="ON":1,1:0)
  1. Q
  1. X D ASK^DIWE11 Q:X="" S DIWL=X,(%,%B)="" X ^%ZOSF("EOFF")
  1. ENT I '$D(DIWL) S DIWL=245
  1. A R X#245:30 E I '$L(X) D S:$L(%B) G XQ^DIWE11
  1. S:X="" X=" " I X?.ANP S Y=X G D
  1. S I=0,Y=""
  1. C S I=I+1 I $E(X,I,999)?.ANP S Y=Y_$E(X,I,999) G D
  1. S %=$E(X,I),%0=$A(%)
  1. I %?1C S %="" I %0=9 S %=$E(" ",1,9-($L(Y)-($L(Y)\9*9)))
  1. S Y=Y_% D S:$L(Y)>DIWL I ":27:13:"[(":"_%0_":") D S
  1. G C
  1. D D S G D:$L(Y)'<DIWL S %B=Y,Y="" G A
  1. S S:$L(%B) %B=%B_$S($E(Y)=" ":"",1:" ") S %=%B_Y,%2=$L(%) Q:'%2 S Y=""
  1. 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
  1. S %B="",DWLC=DWLC+1,@(DIC_"DWLC,0)")=%
  1. Q
  1. TQ ;
  1. W !?4,"IF YOU WANT TO USE TEXT FROM THE '"_J_"' FIELD",!?4,"OF ANOTHER '"
  1. W I,"' ENTRY, TYPE THE NAME OF THAT ENTRY",!?4,"OTHERWISE, "
  1. W "USE A COMPUTED-FIELD EXPRESSION TO DESIGNATE SOME W-P TEXT",!
  1. G Z^DIWE3
  1. ;
  1. IQ ;
  1. 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)
  1. 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_"""."),!
  1. W "Type 'CONTROL-I' (or TAB key) to insert tabs.",!
  1. W "When text is output, these formatting rules will apply:"
  1. W !," A) Lines containing only punctuation characters, or lines containing tabs",!?5,"will stand by themselves, i.e., no wrap-around."
  1. W !," B) Lines beginning with spaces will start on a new line."
  1. W !," C) Expressions between '|' characters will be evaluated as"
  1. W !?5,"'computed-field expressions and then be printed as evaluated"
  1. W !?5,"thus '|NAME|' would cause the current name to be inserted in the text."
  1. W !!,$C(7),"Want to see a list of allowable formatting 'WINDOWS'" S %=2 D YN^DICN Q:%-1
  1. W !?5,"SPECIAL FORMATTING INCLUDES: "
  1. 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)