Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
syntax of the if-then-else construct
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Need help with Runcommand...
by
PizzaProgram
[
Today
at 11:12:32 am]
Cannot find Online Packag...
by
ThomasK
[
Today
at 11:01:51 am]
MVP made easier.
by
cdbc
[
Today
at 10:54:32 am]
Error: Enumeration symbol...
by
440bx
[
Today
at 10:15:13 am]
Anyone interested in help...
by
ad1mt
[
Today
at 08:56:20 am]
Military Grade Directives
by
DavidL
[
Today
at 03:49:55 am]
Hashing pointers by using...
by
440bx
[
Today
at 03:16:33 am]
exception external SIGSEG...
by
dseligo
[
Today
at 02:24:28 am]
Why does the call via fun...
by
Martin_fr
[
Today
at 01:59:35 am]
[SOLVED] Is this a compil...
by
jamie
[
Today
at 01:46:54 am]
Problem installing LazPro...
by
peter.dell
[
Today
at 01:32:53 am]
AI interactions
by
Joanna
[December 13, 2025, 11:47:24 pm]
project - count source li...
by
bobonwhidbey
[December 13, 2025, 10:30:31 pm]
Recomendations for conver...
by
BlueIcaro
[December 13, 2025, 09:49:20 pm]
FPC 3.2.4-rc1 available
by
PeterBB
[December 13, 2025, 08:31:32 pm]
fpsockets error: 10047
by
parcel
[December 13, 2025, 04:03:56 pm]
So many "newbies"
by
Joanna
[December 13, 2025, 02:52:06 pm]
Is it possible to run "mo...
by
Thausand
[December 13, 2025, 02:42:56 pm]
TIBDataSet "Closing"? on ...
by
RedOctober
[December 13, 2025, 02:38:05 pm]
TLazSerial : serial port ...
by
CM630
[December 13, 2025, 02:20:24 pm]
connecting to mariadb
by
alanyoung
[December 13, 2025, 01:27:11 pm]
How to get the standard m...
by
stem
[December 13, 2025, 12:50:55 pm]
Lookup field: error list ...
by
BlueIcaro
[December 13, 2025, 12:00:10 pm]
Anchoring controls with d...
by
jamie
[December 13, 2025, 11:22:45 am]
Recompiled IDE with LCLRe...
by
AlexTP
[December 13, 2025, 05:09:56 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: syntax of the if-then-else construct (Read 4339 times)
SaintMichael57
New Member
Posts: 18
syntax of the if-then-else construct
«
on:
June 30, 2017, 12:23:37 pm »
Dear FreePascal Community:
Could you please describe the syntax of the if-then-else construct
which has imbedded in it compound statements? Thank you.
Best regards,
Carl Mesaros
Logged
marcov
Administrator
Hero Member
Posts: 12571
FPC developer.
Re: syntax of the if-then-else construct
«
Reply #1 on:
June 30, 2017, 12:27:47 pm »
If you go to the manual,
https://www.freepascal.org/docs-html/ref/ref.html
and search for "then" or "else", you'll find
https://www.freepascal.org/docs-html/ref/refsu57.html#x163-18500013.2.3
which has an example of nested if then else.
Logged
Handoko
Hero Member
Posts: 5507
My goal: build my own game engine using Lazarus
Re: syntax of the if-then-else construct
«
Reply #2 on:
June 30, 2017, 12:28:57 pm »
Also this:
http://wiki.freepascal.org/Else
Logged
J-G
Hero Member
Posts: 966
Re: syntax of the if-then-else construct
«
Reply #3 on:
June 30, 2017, 02:08:58 pm »
Quote from: Handoko on June 30, 2017, 12:28:57 pm
Also this:
http://wiki.freepascal.org/Else
To make the nested IF statement clearer, there ought to be a change to the indentation, viz:
Code: Pascal
[Select]
[+]
[-]
if
a
then
if
b
then
begin
(
..
)
end
;
else
begin
(
..
)
end
;
Logged
FPC 3.0.0 - Lazarus 1.6 &
FPC 3.2.2 - Lazarus 2.2.0
Win 7 Ult 64
Eugene Loza
Hero Member
Posts: 729
Re: syntax of the if-then-else construct
«
Reply #4 on:
June 30, 2017, 02:39:37 pm »
Or you might want to check it here
http://castle-engine.io/modern_pascal_introduction.html#_testing_if
Logged
My FOSS games in FreePascal&CastleGameEngine:
https://decoherence.itch.io/
(Sources:
https://gitlab.com/EugeneLoza
)
guest60499
Guest
Re: syntax of the if-then-else construct
«
Reply #5 on:
June 30, 2017, 03:59:44 pm »
I tend to like
this website
despite the ads. I might start referring to the Castle engine's documentation now.
Most places miss the syntax difference between the statement and block versions.
Logged
Thaddy
Hero Member
Posts: 18524
Here stood a man who saw the Elbe and jumped it.
Re: syntax of the if-then-else construct
«
Reply #6 on:
June 30, 2017, 05:02:14 pm »
I have the slight suspicion(
) he is asking about a ternary operator function......
Compound statement?
Logged
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
syntax of the if-then-else construct
TinyPortal
© 2005-2018