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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
show popupmenu in listvie...
by
Ericktux
[
Today
at 01:39:03 am]
fpspreadsheet (Spready) -...
by
tatamata
[
Today
at 01:34:00 am]
Image processing
by
TRon
[
Today
at 01:18:44 am]
Context Sensitive Help fo...
by
dsiders
[
Today
at 12:13:00 am]
Crosshair following Point...
by
chucky
[February 11, 2025, 11:41:11 pm]
Looking for better way...
by
OC DelGuy
[February 11, 2025, 11:32:37 pm]
Custom self drawn compone...
by
VisualLab
[February 11, 2025, 11:18:35 pm]
FPU 80 bit extended preci...
by
srvaldez
[February 11, 2025, 11:04:40 pm]
Circular unit reference b...
by
marcov
[February 11, 2025, 10:49:51 pm]
SplitString issue
by
MarkMLl
[February 11, 2025, 10:47:11 pm]
Learn how to (un)dock a T...
by
MarkMLl
[February 11, 2025, 10:27:43 pm]
[Solved] Accessing parent...
by
nikel
[February 11, 2025, 09:45:03 pm]
Why free pascal suppress ...
by
tetrastes
[February 11, 2025, 09:14:51 pm]
Distance measurments
by
wp
[February 11, 2025, 07:27:07 pm]
Bug and crash. I think th...
by
wp
[February 11, 2025, 07:19:31 pm]
Compile error using FPC3....
by
PepperJules
[February 11, 2025, 06:46:10 pm]
Random Carpet Designs: La...
by
majolika
[February 11, 2025, 06:01:45 pm]
Forum slow?
by
cdbc
[February 11, 2025, 05:52:59 pm]
SIMD Intrinsics in FPC/La...
by
photor
[February 11, 2025, 05:15:21 pm]
JvCLlaz - Duplicate file ...
by
1HuntnMan
[February 11, 2025, 04:29:09 pm]
FLIF and FUIF Formats (Fr...
by
Tomxe
[February 11, 2025, 04:29:05 pm]
Length of String is not f...
by
cdbc
[February 11, 2025, 03:52:45 pm]
BUG in InputQuery if defa...
by
robert rozee
[February 11, 2025, 02:57:42 pm]
my programs crash
by
440bx
[February 11, 2025, 12:55:55 pm]
Lazarus Installation with...
by
ThomasK
[February 11, 2025, 12:30:32 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: syntax of the if-then-else construct (Read 4146 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: 12035
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: 5387
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: 959
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: 16520
Kallstadt seems a good place to evict Trump to.
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
But I am sure they don't want the Trumps back...
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
syntax of the if-then-else construct
TinyPortal
© 2005-2018