Exit Switch or break switch question

Thomas McGrath III 3mcgrath at comcast.net
Thu Mar 20 12:31:49 EDT 2008


Thanks, I agree with your preference here and will stick to the break  
for this button. And, Yes I really like the flexibility of the switch  

Thanks again, I really appreciate your feedback on this.

Tom McGrath

On Mar 20, 2008, at 11:33 AM, Eric Chatonet wrote:

> Hello Tom,
> Le 20 mars 08 à 16:21, Thomas McGrath III a écrit :
>> Thanks, I knew about the behavior of the break and was more curious  
>> if there was a preferred method or 'correct' method. I assume then  
>> that you would definitely use the break. And yeah four chars to  
>> eleven is a point to consider.
>> I was thinking that break was important because of the possibility  
>> of matching more than one method and in hitting the default option.
>> I was thinking that the exit switch ensured that we were done  
>> looking and to stop after the first found item. This would then  
>> skip any other matches.
>> But in a ComboBox there should/can be only one choice chosen from  
>> the menu button so there seems to be no need to continue after a  
>> case was found. But does this make the case (pun) for exit switch  
>> in a combobox?
> As for me I always use break and I like switch structures  
> flexibility and readability compared to conditional ones.
> You can write a list of cases (and I find it more clear that the use  
> of 'or'), put a break or not and have a 'default' case that usually  
> I reserve for errors handling.
> In menuPick handlers switch is invaluable.
> But sure, you know all that yet :-)
> Best regards from Paris,
> Eric Chatonet.
> ----------------------------------------------------------------
> Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
> Email: eric.chatonet at sosmartsoftware.com/
> ----------------------------------------------------------------
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

More information about the Use-livecode mailing list