主题:  Case 语句中 otherwise的疑问

jimbob

职务:普通成员
等级:1
金币:0.0
发贴:40
注册:2000/9/27 9:44:25
#12000/12/5 14:40:30
据说在 otherwise语句后面加一个冒号会使语句更加优化,能告诉我下面两个例子的主要区别么?

on keyDown
case (the key) of
"A": go to frame "Apple"
"B", "C":
puppetTransition 99
go to frame "Oranges"
otherwise:
alert "That is not a valid key."
end case

end keyDown

-----------------------------------------

on keyDown
case (the key) of
"A": go to frame "Apple"
"B", "C":
puppetTransition 99
go to frame "Oranges"
otherwise
alert "That is not a valid key."
end case

end keyDown





Call Me Simon

职务:普通成员
等级:2
金币:2.0
发贴:646
注册:2000/9/19 13:56:51
#22000/12/5 15:54:40
我个人的观点, 没有区别, 所谓的优化可能是因为加冒号更符合lingo 的语法。 我也建议使用冒号.



jimbob

职务:普通成员
等级:1
金币:0.0
发贴:40
注册:2000/9/27 9:44:25
#32000/12/5 16:00:32
谢谢飞鸟,按照其他语言的习惯,都是加上 : 的,不过,lingo语法真是太不规范了,有太多的版本



BBDD

职务:普通成员
等级:1
金币:0.0
发贴:80
注册:2000/12/3 20:10:18
#42000/12/5 17:09:05
hehe可能是为了和以前的语法兼容