Welcome, Guest
Username: Password: Remember me
Discussions for our web site sessions, Articles, Gallery, Downloads, Chat, Wiki, etc
  • Page:
  • 1

TOPIC:

If then else, Error in website? 4 weeks 5 hours ago #17456

  • Peter Heckert
  • Peter Heckert's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 64
  • Thank you received: 4
www.pilotlogic.com/sitejoom/index.php/ab...-then-else-statement

elseif is not a Pascal keyword.
Pascal does not interpret non Nil and nozero values as true.
The examples dont compile.
It seems there is another language than pascal described here.

Please Log in or Create an account to join the conversation.

If then else, Error in website? 3 weeks 6 days ago #17457

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4441
  • Thank you received: 1073
Thanks
we fix typo
elseif( =>else if(
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

If then else, Error in website? 3 weeks 6 days ago #17458

  • Peter Heckert
  • Peter Heckert's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 64
  • Thank you received: 4
Thank you and Happy new Year!

This statement in chapter 1. Syntax is also wrong:
"Pascal assumes any non-zero and non-nil values as true and if it is either zero or nil then it is assumed as false value."
Should read: Pascal assumes only boolean expressions or values as true or false everything else is syntax error..

And the brackets in if statements are allowed in Pascal, but are superfluous and not necessary..
Also wrong is this:
program ifelseChecking;
var
{local variable definition }
a : integer;
a is not a local variable (which is on stack) in this case, it is a global variable with static lifetime and is in Data section.
The following user(s) said Thank You: Sternas Stefanos

Please Log in or Create an account to join the conversation.

Last edit: by Peter Heckert.

If then else, Error in website? 3 weeks 6 days ago #17459

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4441
  • Thank you received: 1073
Thanks
Fixed
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

  • Page:
  • 1