10-29-2008 12:27 AM - edited 10-29-2008 12:28 AM
Interesting idea on how to avoid all errors:
====> Wire the "Simple Error Handler" before the function of interest. You'll never get an error 😄

10-29-2008 12:51 AM - edited 10-29-2008 12:52 AM
OK, heres a gem from the same post as above:
Maybe I completely misunderstanding all this, but apparently the programmer simply wants to know the largest of five integers.
Besides the fact that the code is seriously flawed to begin with (and can give incorrect results), does it really need

I would like to see the code if we need to get the largest of 50 integers. 😮
11-04-2008 02:46 PM
So, we get a key character from an event terminal (as I16) and need to see if it matches a certain key.
Simple (as seen here)!
(...or we could just compare the Char directly. :D)
11-04-2008 03:16 PM
11-04-2008 06:28 PM
LOL!! I needed that laugh. Good one Saverio. 😄
Also excellent posts by Christian.. 🙂
11-05-2008 02:45 PM
altenbach,
Do you mean comparing the char directly with the ascii representation (i.. 43 for the "+")?
If so, although your suggestion is indeed quicker to execute, does the human factor of looking at the code and seeing what it does not come into it? I mean the "clumsy" code would still execute in a few femtoseconds!
I am curious as I have used code like this before!!! (If you can provide a slick way of directly comparing to the "+" character please do show)
11-05-2008 03:17 PM - edited 11-05-2008 03:18 PM
nrp wrote:If so, although your suggestion is indeed quicker to execute, does the human factor of looking at the code and seeing what it does not come into it?
I agree, speed is irrelevant here. The main point is diagram clutter. If you jump through so many hoops, another programmer might not understand why.
If you want to support the "human factor", you can start with a "+" string and convert it to the number outside the loop. This only needs to be done once. (see image)

(You could also simply show the label of the I16 diagram constant (61) and type e.g. "+ key" as label to make things easier to read.)
11-06-2008 01:18 PM
11-06-2008 01:43 PM
As one who is relatively new to LabView,I found this thread rather... enlightening.
Is there also a thread in which you have shared particularly elegant or clever (in a
good way) solutions you have come across? You know, the kind of constructs
that make you say, "Oh! I wish *I* had thought of that!"
Thanks and Best Regards,
-- J.
11-06-2008 01:46 PM
JeffBuckles wrote:Is there also a thread in which you have shared particularly elegant or clever (in a
good way) solutions you have come across?
LabVIEW nuggets perhaps?