esmith Posted May 27, 2009 Share Posted May 27, 2009 Dan used a conditional operator to replace an if/then/else statement when defining a variable in this post. Can the conditional operator be used to return values instead of assigning them? I can't seem to validate this code: (Field("Indicia") == "1st Class") ? return Resource("Resource1") : return NullResource(); but this works just fine: if (Field("Indicia") == "1st Class") return Resource("Resource1"); else return NullResource(); Can I get an advanced lesson on when I can use the conditional operator versus typing the entire if/else statement? P.S. Does anyone else have problems trying to get the CODE tags to work correctly on the first try?! Link to comment Share on other sites More sharing options...
This topic is now archived and is closed to further replies.