Text buffer analogue of Strings.Prefix.
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
Hi Peter, [...]
PROCEDURE Prefix*(CONST pre, str(** in *): ARRAY OF CHAR):BOOLEAN; Incidental question: what is the significance of CONST in the declaration? PROCEDURE Prefix*(pre, str(** in *): ARRAY OF CHAR): BOOLEAN; ?
as far as I know, the parameter is handled like a VAR parameter, i.e. only the address is handed over and not the whole arrays copied to the stack, and the compiler ensures that it is not modified (nor given as a VAR parameter to yet another procedure). regards -- Bernhard
participants (2)
-
peter@easthope.ca -
Treutwein Bernhard