[Oberon] problem with code

Duke Normandin dukeofperl at ml1.net
Sat Sep 4 04:02:10 MEST 2010

I took Chris Glur's advise and started reading - besides some others -
the *apter*.Text present in SYS: Chapter5.Text has this text whose
Module name I changed to suit:

MODULE Font2Courier12;
	IMPORT Fonts, Oberon, Texts;

	PROCEDURE Highlight*;
	VAR T: Texts.Text; fnt: Fonts.Font;
		T := Oberon.MarkedText();       (* get marked text *)
		IF T # NIL THEN (* was a text found? *)
			fnt := Fonts.This("Courier12.Scn.Fnt ");

    	(* change font of entire text *)
			Texts.ChangeLooks(T, 0, T.len, {0}, fnt, 0, 0)
	END Highlight;

END Font2Courier12.


However, after "marking" some text - say Chapter5.Text - by using F1,
the code "Traps" out and hoses the Text Viewer, i.e. I can't Grow it,
Close it, nothing! BTW, is there a way to redraw the screen/viewer?

I guess I have to learn to use the "Trap" info, which Reiser's book
will probably expound on. In the meantime, can anybody see what could
be making the above code behave so badly when executed? It compiles
cleanly. TIA...

More information about the Oberon mailing list