[Oberon] Re: N-O Scanner structure confusing ?
Bob Walkden
bob at web-options.com
Sun Feb 4 20:27:04 MET 2007
[...]
>
> > Here's a simple job which I can't acheive -- directly yet.
> > 1. set the caret
> > 2. scan from the caret until the token "END"
> > 3. reset the caret after the found token.
> >
[...]
>
> Texts.Scan(S);
> IF (S.class = Texts.Name) & (S.s = "END") THEN
> TextFrames.SetCaret(F, Texts.Pos(S));
>
> Some longer fraction of Version4 code, leaving out full
> preconditioning related to the frame:
>
> PROCEDURE Do*; (* Test.Do *)
> VAR F: TextFrames.Frame; S: Texts.Scanner;
> BEGIN
> F := Oberon.FocusViewer.dsc.next(TextFrames.Frame);
> IF F.hasCar THEN
> Texts.OpenScanner(S, F.text, F.carloc.pos); Texts.Scan(S);
> WHILE ~S.eot & ((S.class # Texts.Name) OR (S.s # "END")) DO
> Texts.Scan(S)
> END;(***)
> IF ~S.eot THEN
> TextFrames.SetCaret(F, Texts.Pos(S))
> END
> END
> END Do;
>
> In a frame viewing all lines of this procedure at once
> place the caret within these lines in front of the first "END"
> which is of class Texts.Name (before "(***)"), invoke the
> "Test.Do" command, the caret should show up
> just to the right of the semicolon that follows this "END".
> Invoke the command again and the caret jumps to a position
> behind the next END.
>
I use the ETH version for Windows, and the native version on bare
Intel hardware. N-O does not seem to have Oberon.FocusViewer. Anybody
know where the FocusViewer variable is in N-O?
Bob
More information about the Oberon
mailing list