Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, TedMar, dr_panther, Ayumi), 1,048 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
the comparisons of if clauses are still executed completely #328446
06/13/10 11:17
06/13/10 11:17
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Currently all comparisons of an if-clause are executed completely. I know that this behaviour was posted some time ago and it was announced that it should be changed within one of the following gs versions, but it hasn't been changed yet.

The following code still leads into an error:
Code:
void main() {
	ENTITY* ent = NULL;
	if (ent != NULL && is(ent, FLAG1)) {
		beep();
	}
}



Would be great if this could be changed. This behaviour leads into ugly if-else blocks with code duplication.

Regards,
Pegamode.

Re: the comparisons of if clauses are still executed completely [Re: pegamode] #328450
06/13/10 11:29
06/13/10 11:29
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Seconded, that would be really nice to have...

Re: the comparisons of if clauses are still executed completely [Re: Rei_Ayanami] #328469
06/13/10 13:35
06/13/10 13:35
Joined: Apr 2010
Posts: 265
V
Vinous_Beret Offline
Member
Vinous_Beret  Offline
Member
V

Joined: Apr 2010
Posts: 265
may be,but you can make you'r code even shorter:
Code:
void main() {
	ENTITY* ent = NULL;
	if (ent && is(ent, FLAG1)) {
		beep();
	}
}



Re: the comparisons of if clauses are still executed completely [Re: Vinous_Beret] #328472
06/13/10 13:39
06/13/10 13:39
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
beret, this has nothing to do with the topic. In fact its just spam.

@Topic: I agree, this would be very nice.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: the comparisons of if clauses are still executed completely [Re: WretchedSid] #328481
06/13/10 14:04
06/13/10 14:04
Joined: Apr 2010
Posts: 265
V
Vinous_Beret Offline
Member
Vinous_Beret  Offline
Member
V

Joined: Apr 2010
Posts: 265
Quote:
beret, this has nothing to do with the topic. In fact its just spam.

and why is that??
besides,my last post was full of ironic! grin .
and iam definitely with this suggestion.

Last edited by Vinous_Beret; 06/13/10 14:17.
Re: the comparisons of if clauses are still executed completely [Re: Vinous_Beret] #328483
06/13/10 14:13
06/13/10 14:13
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Because it is not about the shortness of code ...

Re: the comparisons of if clauses are still executed completely [Re: Rei_Ayanami] #328484
06/13/10 14:18
06/13/10 14:18
Joined: Apr 2010
Posts: 265
V
Vinous_Beret Offline
Member
Vinous_Beret  Offline
Member
V

Joined: Apr 2010
Posts: 265
Quote:
Because it is not about the shortness of code ...

i know man,give me a break,it was only a JOKE... grin
"I forgot to put that SMILY up there"

@Sylar: if i want to post spam,i could only say"YES" or "NO".

Last edited by Vinous_Beret; 06/13/10 18:02.
Re: the comparisons of if clauses are still executed completely [Re: Vinous_Beret] #328525
06/13/10 18:31
06/13/10 18:31
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: Vinous_Beret

@Sylar: if i want to post spam,i could only say"YES" or "NO".

What the fuck is wrong with you? Your post was clearly spam. And if it was really ironic, it wasn't even funny.

Posting Yes or No in such a thread makes clearly more sense, as the developer know how many users want or not want this feature. So they can decide how important a feature is.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: the comparisons of if clauses are still executed completely [Re: WretchedSid] #328528
06/13/10 18:36
06/13/10 18:36
Joined: Apr 2010
Posts: 265
V
Vinous_Beret Offline
Member
Vinous_Beret  Offline
Member
V

Joined: Apr 2010
Posts: 265
Quote:
What the fuck is wrong with you? Your post was clearly spam. And if it was really ironic, it wasn't even funny.


who the fuck are you to talk like this??
listen you FUCK,it's you'r fucking problem if you didn't laugh!
don't you ever use this language with me mad

Re: the comparisons of if clauses are still executed completely [Re: Vinous_Beret] #328529
06/13/10 18:38
06/13/10 18:38
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Vinous, please, stop posting such things...

this was really not funny, no one has laughed wink

just a friendly reminder, not that any mod will ban you wink

Page 1 of 4 1 2 3 4

Moderated by  aztec, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1