I don't get this. If a switch is set to "latch" then it will only be true
once, then it pops back out. For critical purposes and code re-use this is
better to my mind than using locals. You can not have a local of a switch
set to latch; it can only be read at one point in the code and it will only
be true once. Using locals does not increase reliability- it decreases it.
If you're using locals then it's not clear from looking at the code that
there isn't a local somewhere else that can do something, and you can create
as many more locals in as many places as you like on subsequently editing
poorly understood code. If you have a switch set to latch and you create a
local it's very obvious what's happened because the VI immediately breaks.
Certainly
it *works* either way- as you say there's always more than one
way. I just don't understand your reasoning here.
Jared wrote in message
news:101-5065000000050000005A190000-982303670000@quiq.com...
> Dennis is, of course, correct. And we all know local variables are
> sloppy coding. I would not use 'latch when...' way for situations
> where it is CRITICAL the code only executes once. This is mainly for
> re-use reasons. If i need to go back 6 months or a year from now, or
> if someone else takes over my code, it is clear that the code must
> reset the switch as soon as this case executes. Looking at my code
> should tell others they shouldn't switch to the other 'switch when...'
> modes. This might not be clear using the 'Latch when...' modes.
>
> There is always more than 1 way to skin a cat (or write code)!!
>
> Jared