Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-03 - decus/20-0078/libsim/splitc.sim
There is 1 other file named splitc.sim in the archive. Click here to see a list.
OPTIONS(/E/C/-A/-D/-I);
EXTERNAL TEXT PROCEDURE scanto;
INTEGER PROCEDURE splitc(t,del,ta,n);
TEXT t;   CHARACTER del;   TEXT ARRAY ta;   INTEGER n;
!
This procedure splits the text T into parts as divided
by the character delimiter DEL and makes the elements of
TA[1:N] denote the different parts of T (without DEL).
The returned value SPLITC is the number of parts found.
However, if more than N parts are found, the value -1 is
returned.
Author: Mats Ohlin, FOA 1, Fack, S-104 50 STOCKHOLM 80, SWEDEN.
Date: 760916
;
BEGIN   INTEGER i;
    OPTIONS(/A); ta[1]:- ta[n];; ! Check array bounds;
    OPTIONS(/-A);
    t.Setpos(1);
    FOR i:= i+1 WHILE t.More DO
    IF i>n THEN
    BEGIN   splitc:= -1;   GOTO exit   END
    ELSE  ta[i]:- scanto(t,del);
    splitc:= i-1;
    FOR i:= i STEP 1 UNTIL n DO ta[i]:- NOTEXT;
    exit:
END of splitc;