### Re: [Flashcoders] understanding a simpe statement 2

```
Hi Isaac,

http://snipplr.com/view/15019/shorthand-code-for-assigning-a-value/

Cheers,

Sidney de Koning

On Jul 13, 2009, at 4:06 PM, Isaac Alves wrote:

I would like to understand that one too:

maxH = maxH == 0 ? maxW : maxH;

Thanks!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Sidney de Koning - be a geek, in rockstar style!
Flash / AIR Developer @ www.funky-monkey.nl
Technical Writer @ www.insideria.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

```

### [Flashcoders] understanding a simpe statement 2

```I would like to understand that one too:

maxH = maxH == 0 ? maxW : maxH;

Thanks!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

```

### RE: [Flashcoders] understanding a simpe statement 2

```If maxH is equal to 0 then set maxH to maxW else to maxH.

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Isaac Alves
Sent: maandag 13 juli 2009 16:06
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] understanding a simpe statement 2

I would like to understand that one too:

maxH = maxH == 0 ? maxW : maxH;

Thanks!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

```

### Re: [Flashcoders] understanding a simpe statement 2

```
Hi,

They are both statements using the ternary operator - you had the
right idea in your prevouse email.

Basically it reads (If the condition before the qestion mark is
true) ? do this : otherwise do that;

It is often better to write out your ternary statement with brackets
because it helps make it a bit clearer.

Something like this:

maxH = (maxH == 0) ? maxW : maxH;

Glen

Isaac Alves wrote:

I would like to understand that one too:

maxH = maxH == 0 ? maxW : maxH;

Thanks!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

```