[Oberon] Re: Text.Buffer usage.

peter at easthope.ca peter at easthope.ca
Sat Dec 17 20:29:31 CET 2016


From:	peter at easthope.ca
Date:	Sat, 17 Dec 2016 08:54:25 -0800
> SD is appended to DB according to,
> "(* Append copy of source buffer SB to destination buffer DB. *)
>  PROCEDURE Copy (SB, DB: Buffer);"
>  
> Then ... empty SD and reset the Writer.

In the following, for example, how can "Reset phrase" be accomplished?

Thanks,                   ... Lyall E.

VAR
	ch: CHAR;
	phrase: Texts.Writer; (* Intermediate storage as ch are read and processed. *)
	accum: Texts.Buffer; (* Storage where processed phrases are accumulated. *)
BEGIN
	...
	Texts.OpenWriter(phrase);
	Texts.OpenBuf(accum);
	...
	Texts.Write(phrase, ch);
	...
	Texts.Write(phrase, ch);
	...
	Texts.Copy(phrase.buf, accum);
	(* Reset phrase *)
	...
	Texts.Write(phrase, ch);
	...
	Texts.Write(phrase, ch);
	...
	Texts.Copy(phrase.buf, accum);
	etc.
	

-- 

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