12-10-2013 05:07 AM - edited 12-10-2013 05:08 AM
Hello all,
I'm a student and still finding a lot of stuff to practice.
When I read a thread an hour ago, I found something new to research .
Anyway, some people use very many Boolean indicators and connect them together, so they all have the same value.
In text written code you'll get something like this
#define True=1;
#define False=0;
for ( x = 0; x < 10; x++ ) {
"Tube_"<<i=True;
}
I don't know if the syntax works, but you'll get the idea.
That's pretty short code right.
Implementing it in Labview is a little harder using a for loop.
I made two different solutions. My question is: Is there a better solution to this problem and why?
Koen
Btw, just found out that Labview forum doesn't recognize it's own brand
12-10-2013 08:50 AM
It does if you spell it right: LabVIEW (notice the capitalization)
Cameron
@KoenR94 wrote:
Hello all,
Btw, just found out that Labview forum doesn't recognize it's own brand
![]()
12-10-2013 08:58 AM
No comment
It does if you spell it right: LabVIEW (notice the capitalization)
12-10-2013 09:17 AM - edited 12-10-2013 09:18 AM
I altered your second option to make it a little more efficient.
In general, I go with your first option, but have done things similar to your second. But I don't like doing this just for the sake of setting values. I do this type of setup when dealing with many other properties (like Disable, Visible).
12-10-2013 09:37 AM
Hello crossrulz,
Thank you for the reply.
Pretty neat idea of that conditional for-loop, didn't knew it existed
Your way is a lot faster probably. Just one problem to it, the "To More Specific Class" won't work in the first for loop.
This is most likely due to the other controls?? Anyway changed it to this and now it does function:
What is your reason that you won't do it for values?
Thanks in advance
Koen
12-10-2013 09:54 AM
Crossrulz didn't say he "Would not" he said he would avoid it. and so would I
Really, think about why you are doing something..... the boolean terminal already exists so the info is already presented to the user. what do you gain by presenting it ten more times?
12-11-2013 02:37 AM
Maybe when you use it in a bigger program.
It could be possible that you aren't able to reach those ternimals, without the use of local ofcourse.
I think when you use it multiple times in a program it will use less space and keeps things clear.
Any other suggestions are welcome ofcourse