RE: [Flashcoders] Shorhand for if statement without else statement

2007-01-29 Thread Steven Sacks | BLITZ
(foo) ? foo() : (bar) ? bar() : (foobar) ? foobar() : trace(sorry! no soup for you!); I feel like I need a shower after that one. ;) ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive:

RE: [Flashcoders] Shorhand for if statement without else statement

2007-01-29 Thread Alain Rousseau
Gee ! didn't know it was such a dirty hack ! lol -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ Sent: 29 janvier 2007 13:14 To: Flashcoders mailing list Subject: RE: [Flashcoders] Shorhand for if statement without else statement

Re: [Flashcoders] Shorhand for if statement without else statement

2007-01-29 Thread Andy Herrman
Heh, that's nothing. I don't have the code available, but I once wrote a ?: statement that was something like 16 deep. Ah, those were the days. :) -Andy On 1/29/07, Steven Sacks | BLITZ [EMAIL PROTECTED] wrote: (foo) ? foo() : (bar) ? bar() : (foobar) ? foobar() : trace(sorry! no soup

[Flashcoders] Shorhand for if statement without else statement

2007-01-26 Thread Helmut Granda
does anybody knows if there is any short hand for if statement without the else statement? at the moment I am using object ? true : null; thanks... ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive:

Re: [Flashcoders] Shorhand for if statement without else statement

2007-01-26 Thread Andy Herrman
Usually ?: notation is used specifically for quickly choosing between 2 values (picking between 2 things inline). That's a case where you really have to have an else, otherwise you wouldn't have a value to represent the failure case of the IF part. If you're doing logic that isn't inline in a

Re: [Flashcoders] Shorhand for if statement without else statement

2007-01-26 Thread Paul Andrews
if ( condition){ } ? - Original Message - From: Helmut Granda [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, January 26, 2007 9:01 PM Subject: [Flashcoders] Shorhand for if statement without else statement does anybody knows

Re: [Flashcoders] Shorhand for if statement without else statement

2007-01-26 Thread eka
hello :) I don't understand you question ? why you don't use the if keyword ? if ( isNaN(x) ) x = 0 ; you can use the || operator too function write ( txt ) { var message = txt || empty message ; trace(message) ; } write(hello) ; // output : hello write() ; // output : empty message

Re: [Flashcoders] Shorhand for if statement without else statement

2007-01-26 Thread John Mark Hawley
Subject: [Flashcoders] Shorhand for if statement without else statement does anybody knows if there is any short hand for if statement without the else statement? at the moment I am using object ? true : null; thanks... ___ Flashcoders

Re: [Flashcoders] Shorhand for if statement without else statement

2007-01-26 Thread Helmut Granda
Mark Hawley From: Helmut Granda [EMAIL PROTECTED] Date: 2007/01/26 Fri PM 03:01:25 CST To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Shorhand for if statement without else statement does anybody knows if there is any short hand for if statement

Re: [Flashcoders] Shorhand for if statement without else statement

2007-01-26 Thread eka
Granda [EMAIL PROTECTED] Date: 2007/01/26 Fri PM 03:01:25 CST To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Shorhand for if statement without else statement does anybody knows if there is any short hand for if statement without the else statement

RE: [Flashcoders] Shorhand for if statement without else statement

2007-01-26 Thread Steven Sacks | BLITZ
does anybody knows if there is any short hand for if statement without the else statement? 1. You can remove the braces. I always use: if (true) something(); But rarely use: if (true) something(); else somethingElse(); because it can get lost visually in code. 2. Inline conditional I

Re: [Flashcoders] Shorhand for if statement without else statement

2007-01-26 Thread eka
Hello :) In FDT for example : cond ? methodA() : methodB() failed :) The operator cond ? true : false is used to return a value but isn't really the good solution to launch method i think :) EKA+ :) 2007/1/26, Steven Sacks | BLITZ [EMAIL PROTECTED]: does anybody knows if there is any

Re: [Flashcoders] Shorhand for if statement without else statement

2007-01-26 Thread Helmut Granda
On 1/26/07, Steven Sacks | BLITZ [EMAIL PROTECTED] wrote: does anybody knows if there is any short hand for if statement without the else statement? 1. You can remove the braces. I always use: if (true) something(); I like it... ___

RE: [Flashcoders] Shorhand for if statement without else statement

2007-01-26 Thread Steven Sacks | BLITZ
- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of eka Sent: Friday, January 26, 2007 2:27 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Shorhand for if statement without else statement Hello :) In FDT for example : cond ? methodA() : methodB() failed

RE: [Flashcoders] Shorhand for if statement without else statement

2007-01-26 Thread Steven Sacks | BLITZ
( condition ) ( code ); Hot! I wonder how many of these shortcuts we can come up with that nobody would use unless they were trying to show off to other codemonkeys. :) ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or

Re: [Flashcoders] Shorhand for if statement without else statement

2007-01-26 Thread Alain Rousseau
Subject: Re: [Flashcoders] Shorhand for if statement without else statement Hello :) In FDT for example : cond ? methodA() : methodB() failed :) The operator cond ? true : false is used to return a value but isn't really the good solution to launch method i think :) EKA