[Oberon] VNC.Open inconsistency
Felix Friedrich
felix.friedrich at inf.ethz.ch
Thu Aug 7 08:41:40 CEST 2014
Dear Sage,
thank you very much for this. An adapted version is now in the repository.
Specifying a question mark "?" as password will still open a dialog in
order to hide passwords from observers, otherwise taken over as provided.
Best
Felix
>
> Hi Oberon Comunity!
>
> There is a small inconsistency in A2's VNC.Open command. It actually
> makes impossible for A2 newbies to use both of VNC examples present in
> system (VNCTetrisServer and WMVNCView).
>
> Both examples by default does not require password for connection
> establishing, but VNC.Open at first incorrectly handles password
> omission in command line and at second on password omission requests
> password through the dialog and finishes with error if user will omit
> it again in the dialog. And at third this behaviour even does not
> correspond to syntax presented to user by message "Error: expected
> server[ pwd] port".
>
> Correct code, probably, will be following:
>
> PROCEDURE Open*(context : Commands.Context); (** server[ pwd] port *)
> VAR
> server: IP.Adr; res, port: LONGINT;
> c: Connection; pwd: ARRAY 32 OF CHAR; svr, title: ARRAY 128 OF CHAR;
> BEGIN
> context.arg.SkipWhitespace; context.arg.String(svr);
> context.arg.SkipWhitespace;
> IF (context.arg.Peek() < "0") OR (context.arg.Peek() > "9") THEN
> context.arg.String(pwd) END;
> context.arg.SkipWhitespace; context.arg.Int(port, FALSE);
> IF (context.arg.res = Streams.Ok) OR (context.arg.res = Streams.EOF) THEN
> DNS.HostByName(svr, server, res);
> IF (res = Ok) & (port # 0) THEN
> NEW(c);
> OpenVNC(c, server, port, pwd);
> IF c.res = Ok THEN
> pool.Add(c);
> COPY(svr, title); Files.AppendStr(" Port ", title);
> Files.AppendInt(port, title); Files.AppendStr(" - VNC ", title);
> Files.AppendInt(c.id, title);
> c.w.SetTitle(WMWindowManager.NewString(title));
> Show(context)
> ELSE
> context.error.String("Error "); context.error.Int(c.res, 1);
> context.error.Ln
> END
> ELSE
> context.error.String("Error: not found"); context.error.Ln
> END
> ELSE
> context.error.String("Error: expected server[ pwd] port");
> context.error.Ln
> END;
> END Open;
>
>
> ---
> Cheers, SAGE
> http://sage.com.ua/
>
>
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.inf.ethz.ch/pipermail/oberon/attachments/20140807/b5a83a9c/attachment.html
More information about the Oberon
mailing list