[Oberon] Resetting a file rider without creating a new stream.

peter at easthope.ca peter at easthope.ca
Sat Apr 24 04:12:27 CEST 2021


Hi,

I'm interested to add this procedure to the Oberon Mail module.

	PROCEDURE WriteMsgLine(CONST no: SIGNED32);
	VAR
		len, pos: SIGNED32;
		h: MIME.Header;
		cont: MIME.Content;
		str: ARRAY BufLen OF CHAR;
		strm: Streams.Stream;
	BEGIN
		Texts.WriteString(W, "Mail.Show "); Texts.WriteInt(W, no, msgNoWidth); Texts.Write(W, " ");
		strm := Streams.OpenFileReader(msgsF, msgs[0].pos); strm.mode := Streams.binary;
		Files.Set(strm.R, msgsF, msgs[no].pos);
		...
	END WriteMsgLine;

No problem with the two lines following BEGIN.  The third line is 
meant to reposition the rider on msgsF but it fails to compile.   

A FileStream extends a Stream and has rider R.  A Stream does not have 
a rider and consequently strm.R is meaningless.  A new stream with new 
rider can be created but changing the rider in the existing stream 
would be more efficient.

Is there a way change the rider without creating a new stream.

Thx,              ... P.L.

-- 
VoIP: +1 604 670 0140            Bcc: peter at easthope. ca



More information about the Oberon mailing list