System: WIN32 (XP)
Compiler: FreePascal
Libraries: -

I know I know: I should know the use of IF THEN ELSE, but you know what it is? I'm used to the IF ELSE and IF ELSE-IFs (etc.) of C++ and Perl and such. For example in C++ I sometimes did stuff like...

Code:
if &#40;x <= y&#41;&#123;
	do_stuff&#40;&#41;;
&#125;

else if &#40;...&#41;&#123;
	do_otherstuff&#40;&#41;;
	do_more&#40;&#41;;
&#125;

else if &#40;...&#41;&#123;
	do_this&#40;&#41;;
&#125;

else&#123;
	do_that&#40;&#41;;
	do_this&#40;&#41;;
&#125;
It's so easy, 'cause whenever there's a keyword I just use { } and get it over with, even if there's one statement. I also just put a ; after every statement or expression or whatever, and I can easily use IF and ELSE-IFs (and an opional ELSE).

When I'd try something like that (the IF-ELSE and such) with Pascal, I'm just getting totally confused with something that should be so simple, and I try to keep things even simpler than I could have done, I almost even avoid the IF-THEN-ELSE with BEGIN-ENDs and just rely on many IFs alone sometimes.

Is that piece of code there above equivalent to....

[pascal]
if (x <= y) then begin
do_stuff; {or I could just remove BEGIN-END and ; here?}
end;

else begin
if (...) then begin
do_otherstuff;
do_more;
end;
if (...) then begin
do_this;
end;
else begin
do_that;
do_this;
end;
end;
[/pascal]

Arrrgh! These kinds of things are the most annoying syntax critters I encounter(!), but for the rest I mostly love the language (though I wouldn't mind a # instead of <> )


(* Why not just make it easier and force a BEGIN-END and force the use of ; every every statement and after every END? *)