[Oberon] Syntax details.

peter at easthope.ca peter at easthope.ca
Sun Oct 21 17:42:23 CEST 2018

From:	Andreas Pirklbauer <andreas_pirklbauer at yahoo.com>
Date:	Sat, 20 Oct 2018 19:40:39 +0200
> PS: ...
>     v := Oberon.MarkedViewer(); F := v.dsc;
>     CASE F OF
>       TextFrames.Frame: Texts.OpenScanner(nameS, F.text, 0); Texts.Scan(nameS)
>     END ;

Good.  Thanks.

As A2 Oberon disallows CASE of types I used IF.

MODULE Test IN Oberon;
	IMPORT Display, Oberon, Texts, TextFrames, Documents, Out, Viewers;
		nameS: Texts.Scanner;
	PROCEDURE Identify*;
			v: Viewers.Viewer;
			F: Display.Frame;
		IF Oberon.Pointer.on THEN
			IF Documents.MarkedDoc() # NIL THEN
				Out.String("Test.Identify(): Marked Document is named ");
				Out.String(Documents.MarkedDoc().name); Out.Char("."); Out.Ln;
				IF Oberon.MarkedViewer() # NIL THEN
					Out.String("    Test.Identify(): Oberon.MarkedViewer() # NIL.  ?"); Out.Ln
			ELSIF Oberon.MarkedViewer() # NIL THEN
				v := Oberon.MarkedViewer();
				F := v.dsc;
				IF F IS TextFrames.Frame THEN
					Texts.OpenScanner(nameS, F(TextFrames.Frame).text, 0); Texts.Scan(nameS);
					Out.String("Test.Identify(): Marked Text viewer is named ");
					Out.String(nameS.s); Out.Char("."); Out.Ln
				Out.String("Test.Identify(): Pointer is on but Test.Identify() failed."); Out.Ln
			Out.String("Test.Identify(): pointer is off."); Out.Ln
	END Identify;
END Test.

So I've managed to distinguish a Document from a Text viewer but 
not to distinguish Text in a document from an image, button, scoll bar
& etc.

This in Oberon.Documents.Mod is puzzling.

> (** Returns the marked document (with F1). NIL is returned when no document is marked. 
>     The visibility of the Oberon pointer is ignored. *)
> PROCEDURE MarkedDoc*(): Document;
> VAR M: LocateMsg; V: Display.Frame;
> 	IF TRUE (* Oberon.Pointer.on *) THEN

There must be a requirement to retrieve the marked document whether  
the * is off or on; but a mark which isn't visible seems odd.  Ideas?

Thanks,                     ... Lyall E.

Message composed and transmitted by software designed to avoid the 
need, overhead and vulnerability of antivirus software.

123456789 123456789 123456789 123456789 123456789 123456789 123456789
Tel: +1 360 639 0202                                  +1 
http://easthope.ca/Peter.html              Bcc: peter at easthope. ca

More information about the Oberon mailing list