MaxScript中 Case和If语法的案例
1.对于Case语法的小案例
rollout myRoll "case test" ( spinner s1 "pick a number" range:[0,3,0] type:#integer button b1 "press me" on b1 pressed do ( case s1.value of ( 0:( messagebox "too small" ) 1:( messagebox "just right" ) 2:( messagebox "too big" ) default:( messagebox "default") ) ) ) createdialog myRoll width:200 height: 75
2.对于If语法的小案例
rollout myRoll "if test" ( spinner s1 "pick a number:" range:[0,5,0] type:#integer button b1 "press me" on b1 pressed do ( if s1.value == 0 then ( messagebox "zero is small" ) else if s1.value >0 and s1.value < 3 then ( messagebox "Good" ) else if s1.value !=4 and s1.value>2 and s1.value < 6 then ( messagebox "too long" ) ) ) createdialog myRoll width:200 height:75
文章来源: blog.csdn.net,作者:fengda2870,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/fengda2870/article/details/5450400
- 点赞
- 收藏
- 关注作者
评论(0)