ENTEXT ;(WASH ISC)/DLM-Break Text Into 80 Char Segments ;8-28-84
;;7.0;ENGINEERING;;Aug 17, 1993
;EXPECTS STRING IN 'ENORD' - LENGTH OF LINE IN 'ENLTH'
;RETURNS NUMBER OF SEGMENTS IN 'ENNU'
; ENORD(1) - ENORD(ENNU)
CKL ;BRK ORDER STR
S S=1,ENNU=1
S Z=ENLTH,ENORD(ENNU)=""
CL1 S L=$F(ENORD," ",Z) I L=0&(S'=1) S ENORD(ENNU)=ENORD(ENNU)_$E(ENORD,Z-1,$L(ENORD)) G CL2
S ENORD(ENNU)=ENORD(ENNU)_$E(ENORD,S,L-2)
I $L(ENORD(ENNU))>(ENLTH-5) S ENNU=ENNU+1,ENORD(ENNU)=""
S S=L-1,Z=L
G CL1
CL2 K S,L,Z,ENLTH Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENTEXT 527 printed Dec 13, 2024@01:55:44 Page 2
ENTEXT ;(WASH ISC)/DLM-Break Text Into 80 Char Segments ;8-28-84
+1 ;;7.0;ENGINEERING;;Aug 17, 1993
+2 ;EXPECTS STRING IN 'ENORD' - LENGTH OF LINE IN 'ENLTH'
+3 ;RETURNS NUMBER OF SEGMENTS IN 'ENNU'
+4 ; ENORD(1) - ENORD(ENNU)
CKL ;BRK ORDER STR
+1 SET S=1
SET ENNU=1
+2 SET Z=ENLTH
SET ENORD(ENNU)=""
CL1 SET L=$FIND(ENORD," ",Z)
IF L=0&(S'=1)
SET ENORD(ENNU)=ENORD(ENNU)_$EXTRACT(ENORD,Z-1,$LENGTH(ENORD))
GOTO CL2
+1 SET ENORD(ENNU)=ENORD(ENNU)_$EXTRACT(ENORD,S,L-2)
+2 IF $LENGTH(ENORD(ENNU))>(ENLTH-5)
SET ENNU=ENNU+1
SET ENORD(ENNU)=""
+3 SET S=L-1
SET Z=L
+4 GOTO CL1
CL2 KILL S,L,Z,ENLTH
QUIT