[Oberon] A case in S3 Mail.Show.
Jörg
joerg.straube at iaeth.ch
Sat Sep 14 00:37:01 CEST 2019
The preceding lines are there to update the GUI.
The GUI of the mail client has a ListGaget, where every line corresponds to one mail header (date, subject, from, to..)
If somebody calls „Mail.Show 13“, you have to highlight the 13th line in this ListGadget and possibly deselect all other lines of this mail list.
The REPEAT/UNTIL loops through all lines in the ListGadget and only selects (line.sel := TRUE) the line that corresponds to line 13 by comparing the starting position of mail 13 to the „line.key“ stored in the gadget.
The final Gadgets.Update() displays the change of the line selection.
br, Jörg
> Am 13.09.2019 um 21:06 schrieb <peter at easthope.ca> <peter at easthope.ca>:
>
> Hi,
>
> In A2 Oberon, Mail.Show has this.
>
> Attributes.OpenScanner(S, Oberon.Par.text,Oberon.Par.pos);
> Attributes.Scan(S);
> IF S.class = Attributes.Int THEN (* Eg. Mail.Show 13 ~ was invoked. *)
> IF (S.i >= 0) & (S.i < noMsgs) THEN
> obj := FindObj("MailList");
> IF obj # NIL THEN
> WITH obj: ListGadgets.Frame DO
> line := obj.lines;
> REPEAT
> line.sel := msgs[S.i].pos = line.key;
> line := line.next
> UNTIL line = obj.lines;
> obj.sel := TRUE; obj.time := Oberon.Time();
> Gadgets.Update(obj)
> END
> END;
> decodeMessage(S.i, T, FALSE);
> ShowText("Mail.Text", T, TRUE)
> END
>
> decodeMessage() and ShowText() are understandable.
>
> Can anyone help to understand what is accomplished by the preceding lines?
> obj := FindObj("MailList");
> IF obj # NIL THEN
> ...
> END;
>
> If the message number is with the command, it has been invoked from a Text; not
> from the Mail.Panel. Then why is FindObj("MailList") involved?
>
> The module is visible at https://en.wikibooks.org/wiki/Oberon/A2/Oberon.Mail.Mod .
>
> Thanks, ... Lyall E.
>
>
>
> --
> https://en.wikibooks.org/wiki/Medical_Machines
> https://en.wikibooks.org/wiki/Oberon
> Tel: +1 604 670 0140 Bcc: peter at easthope. ca
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
More information about the Oberon
mailing list