[Oberon] Text buffer analogue of Strings.Prefix.
peter at easthope.ca
peter at easthope.ca
Mon Jun 12 18:54:38 CEST 2017
Hello again,
PC Native O. has
(** Is str prefixed by pre? *)
PROCEDURE Prefix*(CONST pre, str(** in *): ARRAY OF CHAR): BOOLEAN;
Does an analogue for Text buffers exist?
Here is the context. Open a reader on a Text and read.
A segment of the Text is copied to a buffer. Later another
segment to another buffer. Then ask whether the 2nd is a prefix of the first.
An alternative is to create two character arrays and use Strings.Prefix
but the buffer idea might be better.
Incidental question: what is the significance of CONST in the declaration?
PROCEDURE Prefix*(pre, str(** in *): ARRAY OF CHAR): BOOLEAN; ?
Thanks, ... Lyall E.
--
123456789 123456789 123456789 123456789 123456789 123456789 123456789
Tel: +1 360 639 0202 Pender Is.: +1 250 629 3757
http://easthope.ca/Peter.html Bcc: peter at easthope. ca
More information about the Oberon
mailing list