John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Catégorie:
Code, syntaxe and commandes
>>>>Look at the switch command
>>>
>>>Switch will not help me in this case as I need 3 cases:
>>>
>>>Both variables defined
>>>
>>>startTime defined
>>>
>>>endTime defined
>>>
>>>I don't see how switch can help - switch is only for checking a single variable against predefined values.
>>
>>That's the problem.... if its not in a blog post, you can't figure it out....Learn to think outside a blog post...
>
>I don't see how it could be used in any efficient way since the parameter to a switch statement must be a simple type.
I didn't say it would be efficient, but the point is that she said a switch wouldn't work when replying to me when I knew it would. You have to think differently than Naomi thinks. Gregory showed her two ways of using the switch, but she can't accept that because she knows it won't work. But I bet, Gregory's solution would be pretty close to as fast as the if's/elses.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement