example on how to read commandline arguments with Texts.

This commit is contained in:
Norayr Chilingarian 2024-01-14 17:15:40 +04:00
parent 5a93546143
commit dfaf2d3622

View file

@ -0,0 +1,24 @@
MODULE argTexts; (* example how to get arguments by using Texts module *)
IMPORT Texts, Oberon;
VAR
S: Texts.Scanner; (* we'll read program arguments with it *)
W : Texts.Writer; (* to write to console *)
T : Texts.Text;
BEGIN
Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos);
Texts.Scan(S);
(*Out.String(S.s); Out.Ln;*)
Texts.OpenWriter (W);
Texts.WriteString(W, "aaa");
Texts.WriteLn(W);
Texts.WriteString(W, S.s);
Texts.WriteLn(W);
Texts.Append(Oberon.Log, W.buf);
END argTexts.