05-27-2011 11:53 AM
I was given coe developed by others to fix and support. While cleaning up the error clusters I started to run acroos the "Clear Error" VI used TOO many places so I did a quick serach to see just how extensive and got this.
I am going to have to take a shower when I get home becuase I feel dirty after touching this code.
Please post your scarry images you come across here.
Take care,
Ben
Solved! Go to Solution.
05-27-2011 12:13 PM
One way to claim "Bug-Free Code!" It will never show an error.
Lynn
05-27-2011 12:33 PM
I was asked to see if I could improve this program...
Needless to say I threw this out and started over from scratch.
05-27-2011 12:40 PM
Ships in the LabVIEW examples! (method re-initialize all to default must be super-secret)
05-27-2011 01:01 PM
I don't have an image of this one program I was asked to help fix but when it was printed out on a large chart plotter (the only way to get a view of what was going on) it covered the entire table in a large conference room. Talk about a nightmare.
05-27-2011 01:21 PM
@Ben wrote:
While cleaning up the error clusters I started to run acroos the "Clear Error" VI used TOO many places so I did a quick serach to see just how extensive and got this.
If an error occurs and nobody sees it, did it really happen??? 😄
I am curious if it was just a misguided attempt to silence automatic error handling?
(Many times errors don't matter and an overzealous effort to "catch" all errors can lead serialization of the code and loss in parallel code optimizations.)
05-27-2011 03:05 PM
Lucky for you there are only eleven!
05-27-2011 03:12 PM
Ok, now you have my curiousity piqued... in LV7 code that I took over, I found numerous instances where, in order to test for the existance of a directory or file, the error cluster was used. In order to preserve dataflow, I added a clear error to each instance of a case structure that had selected the error - is there a preferred alternative? (The VI probably has 5 or 6 clear errors total).
Michael Tracy
Synergy Microwave
05-27-2011 03:21 PM
> Needless to say I threw this out and started over from scratch.
Hey, I think your author went to the same programming school as mine - only throw in some big stacked sequences for good measure... 🙂
Michael Tracy
Synergy Microwave
05-27-2011 03:34 PM - edited 05-27-2011 03:38 PM
I have to admit I do use the clear errors.vi but, to enforce specific behavior.
I specifically use it when scanning a string to a type def'd enum where the string was in a configuration file. I do not want the error handle popping up when some dratted user typoed the file when I can't find what system state got me there The scan from string function allows me to define a default value that I can use in my code to trap the bad value. (Its why most of my AE's have a "Null"<Default> method . they do not ALLWAYS have null code - sometimes they have debug tracing utilities)
I'm assuming that was NOT the case with Ben's example and that it did indicate a horror.