source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOQUTIL.m@ 1608

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

initial load of WorldVistAEHR

File size: 902 bytes
Line 
1PSOQUTIL ;HINES/RMS - MISCELLANEOUS UTILITIES ; 30 Nov 2007 7:59 AM
2 ;;7.0;OUTPATIENT PHARMACY;**294**;DEC 1997;Build 13
3 ;
4LSIG(SIG) ;EXPAND A SIG
5 S SGY="" F P=1:1:$L(SIG," ") S X=$P(SIG," ",P) D:X]"" ;
6 .I $D(^PS(51,"A",X)) S %=^(X),X=$P(%,"^") I $P(%,"^",2)]"" S Y=$P(SIG,"",P-1),Y=$E(Y,$L(Y)) S:Y>1 X=$P(%,"^",2)
7 .S SGY=SGY_X_" "
8 Q SGY
9WRAPTEXT(TEXT,LIMIT,CSPACES) ;
10 ;;FUNCTION TO DISPLAY (WRITE) TEXT WRAPPED TO A CERTAIN COLUMN LENGTH
11 ;;DEFAULT=74 CHARACTERS WITH NO SPACES IN FRONT
12 N WORDS,COUNT,LINE,NEXTWORD
13 Q:$G(TEXT)']"" ""
14 S LIMIT=$G(LIMIT,74)
15 S CSPACES=$S($G(CSPACES):CSPACES,1:0)
16 S WORDS=$L(TEXT," ")
17 W !,$$REPEAT^XLFSTR(" ",CSPACES)
18 F COUNT=1:1:WORDS D
19 . S NEXTWORD=$P(TEXT," ",COUNT)
20 . Q:NEXTWORD="" ;TO REMOVE LEADING OR DOUBLE SPACES
21 . S LINE=$G(LINE)_NEXTWORD_" "
22 . I $L($G(LINE))>LIMIT&(COUNT'=WORDS) W !,$$REPEAT^XLFSTR(" ",CSPACES) K LINE
23 . W NEXTWORD_" "
24 Q
Note: See TracBrowser for help on using the repository browser.