[Oberon] VNC.Open inconsistency

Yaroslav Romanchenko tobject at bk.ru
Tue Aug 5 22:27:37 CEST 2014



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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.inf.ethz.ch/pipermail/oberon/attachments/20140806/46183659/attachment.html 


More information about the Oberon mailing list