home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
- # include "strings.h"
-
- procedure next{(var c: CharOfString; var ch: Char)};
- {
- * c is advanced to point to next char in its string and current char
- * returned in ch
- *
- * precondition
- * c initialised by call to first and not at end of string
- }
- var nxtchunk: stringtail;
- begin
- with c do
- case KIND of
- true: begin { -- header record }
- ch := HD^.HEAD[POS];
- if POS <> slength then
- POS := POS+1
- else begin
- POS := 1;
- nxtchunk := HD^.TAIL;
- { -- change variant }
- KIND := false;
- TL := nxtchunk
- end
- end;
- false: begin { -- tail record }
- ch := TL^.MORE[POS];
- if POS <> slength then
- POS := POS+1
- else begin
- POS := 1;
- TL := TL^.REST
- end
- end
- end{ -- case}
- end;
-