大佬教程收集整理的这篇文章主要介绍了vb.net – 如何避免… else和切换案例,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
有一点是使用类最小化,但仍然更多…
像任务,猫,秒和类型:
if task = 'add' then if cat = "animal" then if sec = "man" then if type = "male" then 'do the following stuffs else 'do the following stuffs end if elseif sec = "horse" then if type = "run" 'do the following stuffs else 'do the following stuffs end if elseif.... end if elseif cat = "plant" then if sec = "land" then if type="tree" then 'do the following stuffs elseif type = "grass" then.. 'do the following stuffs elseif... end if elseif sec = "water" then ... ...
…
更多n更继续n继续
所以想知道如何最小化它们并编写一些有效的代码?
对不起,最近通知任务,秒和类型可能有很多值.我的if语句嵌套嵌套.
更多的解释我的代码也看起来像:
http://thedailywtf.com/Articles/Coding-Like-the-Tour-de-France.aspx
以上是大佬教程为你收集整理的vb.net – 如何避免… else和切换案例全部内容,希望文章能够帮你解决vb.net – 如何避免… else和切换案例所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。