ETH Oberon, source NetSystem.SetUser*.
== Reference == https://en.wikibooks.org/wiki/Oberon/ETH_Oberon/NetSystem.Mod == Observation == Excerpt from the body of SetUser. BEGIN Texts.OpenReader(R, Oberon.Par.text, Oberon.Par.pos); ok := TRUE; entered[0] := 0X; verbose := FALSE; ... IF host[0] # 0X THEN IF (usr[0] = 0X) OR ((pwd[0] = 0X) & (entered[0] = 0X)) THEN ... IF pwd[0] = 0X THEN (* no pwd specified *) IF entered[0] = 0X THEN (* prompt first time *) InputStr("Enter password: ", FALSE, entered); == Question == Isn't (entered[0] = 0X) inevitable when the IF statements are executed? The two ests, entered[0] = 0X, are redundant? Thanks, ... P. -- tel: +1 604 670 0140 Bcc: peter at easthope. ca
I was thinking the password inone of the few modal interactions. If so you need to handle the case where the password command is envoked but the user decided not to enter it. Could that be the reason? ... IF pwd[0] = 0X THEN (* no pwd specified *) IF entered[0] = 0X THEN (* prompt first time *) InputStr("Enter password: ", FALSE, entered); IF entered[0] = 0X THEN RETURN END (* esc *) END; ...
Hello Peter, Am 06.06.2021 um 17:27 schrieb peter@easthope.ca:
== Reference == https://en.wikibooks.org/wiki/Oberon/ETH_Oberon/NetSystem.Mod
== Observation == Excerpt from the body of SetUser.
BEGIN Texts.OpenReader(R, Oberon.Par.text, Oberon.Par.pos); ok := TRUE; entered[0] := 0X; verbose := FALSE; ... IF host[0] # 0X THEN IF (usr[0] = 0X) OR ((pwd[0] = 0X) & (entered[0] = 0X)) THEN ... IF pwd[0] = 0X THEN (* no pwd specified *) IF entered[0] = 0X THEN (* prompt first time *) InputStr("Enter password: ", FALSE, entered);
== Question == Isn't (entered[0] = 0X) inevitable when the IF statements are executed?
No.
The two ests, entered[0] = 0X, are redundant?
No. In your except you missed a WHILE loop. There is a comment above the SetUser procedure declaration that describes why there may be multiple URLs in one call to SetUser. entered[0] is only 0X for the first of them. Regards, Michael
participants (3)
-
Michael Schierl -
peter@easthope.ca -
R. S. Doiel