开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜