Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 838 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 4 1 2 3 4
Re: the comparisons of if clauses are still executed completely [Re: Vinous_Beret] #328533
06/13/10 19:00
06/13/10 19:00
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

who the fuck are you to talk like this??

Wayan Sidney Sastrosatomo Just. Nice to meet you.


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] #328535
06/13/10 19:16
06/13/10 19:16
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
Just calm down.. ok if he did spam, he probably was not aware of your reaction... was some joke ok. let it be.

and besides im still figuring out what the poster said with "This behaviour leads into ugly if-else blocks with code duplication."

code duplication what he means? and how come it executes?
was it supposed to stop on the first condition if ent!=NULL and not check the rest ..or is something different.. im just not getting.

I never though about such situations...

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

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
at the moment you need:

if(ent != NULL)
{
if(is(ent, SHOW))
{ [...] }
}

and we want:

if(ent != NULL /*if here this is already wrong, and the && follows, just stop*/ && is(ent, SHOW))
{
[..]
}

Re: the comparisons of if clauses are still executed completely [Re: Rei_Ayanami] #328540
06/13/10 19:47
06/13/10 19:47
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
It's called short-circuit evaluation:
http://en.wikipedia.org/wiki/Short-circuit_evaluation

Re: the comparisons of if clauses are still executed completely [Re: Joey] #328542
06/13/10 20:20
06/13/10 20:20
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
oh right i though that could be done already OOLOL, my bad.
That could explain some script behaviours not doing okay, and i though was my fault.

Re: the comparisons of if clauses are still executed completely [Re: MMike] #328545
06/13/10 20:44
06/13/10 20:44
Joined: Mar 2006
Posts: 2,252
Hummel Offline
Expert
Hummel  Offline
Expert

Joined: Mar 2006
Posts: 2,252
I had the same prob some days ago, so I would appreciate this short-circuit evaluation thing.

Re: the comparisons of if clauses are still executed completely [Re: Hummel] #328546
06/13/10 21:00
06/13/10 21:00
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I too am STILL waiting on the short-circuit evaluation to be implemented...

I grow tired of using work-arounds like
Code:
void main() {
	ENTITY* ent = NULL;
	if(ent!=NULL) if(is(ent, FLAG1))
	{
		beep();
	}
}

because there is some you just cant do...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: the comparisons of if clauses are still executed completely [Re: EvilSOB] #328548
06/13/10 21:04
06/13/10 21:04
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
Would like to have it too.
Always need an extra IF-block for checking if an entity is valid v.v(tooo many brackets)

Greets
Rackscha


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: the comparisons of if clauses are still executed completely [Re: Rackscha] #328566
06/13/10 23:41
06/13/10 23:41
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I hope it's possible to change it anymore because I would really like to see "short-circuit evaluation", too.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: the comparisons of if clauses are still executed completely [Re: Superku] #328595
06/14/10 08:52
06/14/10 08:52
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Seconded.


Click and join the 3dgs irc community!
Room: #3dgs
Page 2 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