ActionScript ternary operator
in action script
str is string var
str=(some condition)?" store true":"store false";
when i alert the 开发者_如何学Gostr am not getting any message .....why am not getting
code:
[Bindable]
public var errVarMsg:String ;
errVarMsg="";
errVarMsg=(minfee<=maxfee)?"":"fee min > max\n";
Alert.show(errVarMsg);
If minfee
is less than or equal to maxfee
, you'll get an empty alert which might be taken as no message. Change it to
minfee = 5;
maxfee = 10;
errVarMsg = (minfee <= maxfee) ? "min <= max" : "min > max";
Alert.show(errVarMsg);
minfee = 15;
maxfee = 10;
errVarMsg = (minfee <= maxfee) ? "min <= max" : "min > max";
Alert.show(errVarMsg);
精彩评论