[Oberon] Text.Buffer usage.

Alexander Ilin ajsoft at yandex.ru
Sat Dec 17 23:03:41 CET 2016


Hi again!

  I noticed that you were asking about Buffers, not texts.

  To reset contents of the phrase.buf, you may either call Texts.OpenWriter(phrase) again, or Texts.OpenBuf(phrase.buf), depending on your needs.

17.12.2016, 22:29, "peter at easthope.ca" <peter at easthope.ca>:
> 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
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon

---=====--- 
 Александр


More information about the Oberon mailing list