[Oberon] problem with code

Duke Normandin dukeofperl at ml1.net
Sat Sep 4 04:56:48 MEST 2010


On Sat, 4 Sep 2010, Chris Burrows wrote:

> > -----Original Message-----
> > From: oberon-bounces at lists.inf.ethz.ch
> > [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of Duke Normandin
> > Sent: Saturday, 4 September 2010 11:32 AM
> > To: Oberon List
> > Subject: [Oberon] problem with code
> >
> > 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...
>
> This is the process I went through:
>
> 1. I scrolled down the trap viewer until I got to the part which references
> your code:
>
> Font2Courier12.Highlight  PC = 79
> 	T =  009CC780H Texts.TextDesc
> 	fnt =  00000000H (Fonts.FontDesc)
>
> 2. This tells me that the value of fnt is zero which makes me suspect the
> line:
>
>   fnt := Fonts.This("Courier12.Scn.Fnt ");
>
> 3. I guessed that zero means that the font could not be found.
>
> 4. I confirmed that the font was present.
>
> 5. Maybe the problem is the trailing blank in the font name?
>
> 6. Edited, recompiled and it works!

Thanks for the quick walk-through of the "trap" output. I think I get
how it works now.

> To make your code more stable, check that fnt is not NIL before calling
> Texts.ChangeLooks

I know from my Perl days that you are of course correct. I've done the
same thing so often. I don't know what it is, but when I'm in NO, I
get so stressed out  between learning to use and navigate the OS, and
learning the Oberon-2 language, that I have a hard time concentrating
on the good programming practices that I have applied countless times
before. I'll hang in there a bit longer, and see if it comes together
for me. Thanks again!

-- 
Duke


More information about the Oberon mailing list