And, Or, Not?
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
is the same as:
I think 'Then' is really not needed to understand the code...
Have a nice day...
Franco
Edited by - franco on 27 December 2001 21:22:58
Well, 'ElseIf' would be nice, but why 'Then'?I hope the new version also contains "then" (if...then...) and "ElseIf".
Code: Select all
If a=10 Then
do something
EndIf
Code: Select all
If a=10
do something
EndIf
Have a nice day...
Franco
Edited by - franco on 27 December 2001 21:22:58
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
three lines with one line: If a=10 Then do something. You don't need EndIf
when using Then. It stops simple code being spread over many lines, which
can sometimes be a hassle.
Edited by - PB on 27 December 2001 21:37:34
You don't understand, Franco -- using Then means you can replace the aboveCode: Select all
If a=10 do something EndIf
three lines with one line: If a=10 Then do something. You don't need EndIf
when using Then. It stops simple code being spread over many lines, which
can sometimes be a hassle.
Edited by - PB on 27 December 2001 21:37:34
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by redacid.
PB: yes, that`s what I wanted to say!
Why complicated when you can make it simple?
One line says it all: "If a=1 then b=1"
Franco: do you really think this is better:?
if a=1
b=1
endif
"Then" makes your code much more readable. And it`s a "Basic"-Keyword since 20 years and more).
PB: yes, that`s what I wanted to say!
Why complicated when you can make it simple?
One line says it all: "If a=1 then b=1"
Franco: do you really think this is better:?
if a=1
b=1
endif
"Then" makes your code much more readable. And it`s a "Basic"-Keyword since 20 years and more).
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Paul.
I don't know... there doesn't seem to be much of a savings between
and
I wish more versions of BASIC would drop the 'THEN' statement.
Personal preference I guess
I don't know... there doesn't seem to be much of a savings between
Code: Select all
If a=10 Then b=20
Code: Select all
If a=10:b=20:Endif
Personal preference I guess

-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
I didn't use a Basic dialect before that uses 'Then' in that way.
I know BCX-basic, there it goes:
And I know another Basic there it goes:
(without a 'Select' command before and 'EndSelect' after!)
instead of:
But I suppose this don't work with PureBasic...
Have a nice day...
Franco
OK PB, I understand.You don't understand, Franco -- using Then means you can replace the above
three lines with one line: If a=10 Then do something. You don't need EndIf
I didn't use a Basic dialect before that uses 'Then' in that way.
I know BCX-basic, there it goes:
Code: Select all
If a=10 Then
do something
EndIf
Code: Select all
Case a=10 : do something
instead of:
Code: Select all
If a=10 : do something : EndIf
Have a nice day...
Franco
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm