LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Weird IndexVal bug - Code, that shouldn't work


@paul_a_cardinale wrote:

There is no specific relationship between the IndexVals property and which element is referenced by the ArrElem property.

The ArrElem property refers to whichever element most recently had text focus.


Ah, this is actually true, I recall now that in my LabVIEW 6 example I mentioned above, I set the number of visible items of the FP array to one (there is only one array element visible), set the index and THEN read the ArrayElem reference. To be fair, LabVIEW 6 was a LooooOOOOoooong time ago.

0 Kudos
Message 11 of 13
(48 Views)

In your top image, if it works it works only because you're actively clicking on a specific array element. If you click on, for example, the increment or decrement of the array index the event may fire but you'll get the LAST element that was selected. I think it's kind of happenstance that the first example worked at all. It's certainly not implementing all of the safeguards to make sure it works in every circumstance.

 

The second image of code you show shows a disabled case of code, but as shown, this code is.... disabled. I presume now you meant to show that it was an alternate version which you also tested? The code as shown does not tell us which code is actually active within the disable structure i.e. int he "Enabled" frame. In the absence of any other information I suppose one would have to assume it's the version shown int he first screenshot....?

0 Kudos
Message 12 of 13
(44 Views)

As said in the initial post I tried both ways. It's disabled because I provided the code and everyone can en/disable the code however wanted.

 

I eventually threw all the code away because labview lacks almost all ui functionality that can be expected from a language after 2005.

0 Kudos
Message 13 of 13
(26 Views)