XQSUITE1 ;Subroutines for XQSUITE: SuiteMan ;11/29/94 11:47
;;8.0;KERNEL;;Jul 10, 1995
;;KV8
;
SPLIT ;Takes X, Returns Y1 and Y2
N XQIN,XQMID,XQDONE,XQSP
S XQIN=X,XQMID=($L(XQIN)\2)+1,XQDONE=0,XQSP=" "
I $E(XQIN,XQMID)=XQSP S Y1=$E(XQIN,1,XQMID-1),Y2=$E(XQIN,XQMID+1,$L(XQIN))
F XQI=1:1:XQMID-1 Q:XQDONE D
.I $E(XQIN,XQMID-XQI)=XQSP S Y1=$E(XQIN,1,(XQMID-XQI)-1),Y2=$E(XQIN,$L(Y1)+2,$L(XQIN)),XQDONE=1
.Q:XQDONE
.I $E(XQIN,XQMID+XQI)=XQSP S Y1=$E(XQIN,1,(XQMID+XQI)-1),Y2=$E(XQIN,$L(Y1)+2,$L(XQIN)),XQDONE=1
.Q
;W !,XQIN,!,Y1,!,Y2
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXQSUITE1 564 printed Nov 22, 2024@17:16:55 Page 2
XQSUITE1 ;Subroutines for XQSUITE: SuiteMan ;11/29/94 11:47
+1 ;;8.0;KERNEL;;Jul 10, 1995
+2 ;;KV8
+3 ;
SPLIT ;Takes X, Returns Y1 and Y2
+1 NEW XQIN,XQMID,XQDONE,XQSP
+2 SET XQIN=X
SET XQMID=($LENGTH(XQIN)\2)+1
SET XQDONE=0
SET XQSP=" "
+3 IF $EXTRACT(XQIN,XQMID)=XQSP
SET Y1=$EXTRACT(XQIN,1,XQMID-1)
SET Y2=$EXTRACT(XQIN,XQMID+1,$LENGTH(XQIN))
+4 FOR XQI=1:1:XQMID-1
if XQDONE
QUIT
Begin DoDot:1
+5 IF $EXTRACT(XQIN,XQMID-XQI)=XQSP
SET Y1=$EXTRACT(XQIN,1,(XQMID-XQI)-1)
SET Y2=$EXTRACT(XQIN,$LENGTH(Y1)+2,$LENGTH(XQIN))
SET XQDONE=1
+6 if XQDONE
QUIT
+7 IF $EXTRACT(XQIN,XQMID+XQI)=XQSP
SET Y1=$EXTRACT(XQIN,1,(XQMID+XQI)-1)
SET Y2=$EXTRACT(XQIN,$LENGTH(Y1)+2,$LENGTH(XQIN))
SET XQDONE=1
+8 QUIT
End DoDot:1
+9 ;W !,XQIN,!,Y1,!,Y2
+10 QUIT