LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best/Most Efficient Way to Determine What Changed in Array of Cluster

This is a (dirty) way to get only the index of the changed cluster element:

wiebeCARYA_3-1724672034579.png

 

Not sure why that's useful, but 😁 it sure would be efficient, esp. for large arrays...

Message 11 of 16
(336 Views)

Interesting  loop, a while loop that self identifies as a for loop.

0 Kudos
Message 12 of 16
(320 Views)

@LVNinja wrote:

Interesting  loop, a while loop that self identifies as a for loop.


Or rather a for loop that identifies as a while loop.

I really love that method actually! I think it can be programmed faster than the while loop.

CLA
0 Kudos
Message 13 of 16
(317 Views)

@UnholyPenguin wrote:

@LVNinja wrote:

Interesting  loop, a while loop that self identifies as a for loop.


Or rather a for loop that identifies as a while loop.

I really love that method actually! I think it can be programmed faster than the while loop.


More importantly: the result is less and cleaner code.

 

Consider that a while loop will always executes at least once... So you're always stuck with either a case to skip the action, or a redundant action.

0 Kudos
Message 14 of 16
(306 Views)

@LVNinja wrote:

Interesting  loop, a while loop that self identifies as a for loop.


More importantly, the FOR loop will also stop when it runs out of elements. A while loop requires more condition here 

0 Kudos
Message 15 of 16
(284 Views)

wiebe@CARYA wrote:

This is a (dirty) way to get only the index of the changed cluster element:

wiebeCARYA_3-1724672034579.png

 

Not sure why that's useful, but 😁 it sure would be efficient, esp. for large arrays...


Have used this one before. Is less janky and weird as it first feels.

 

You can also get the name of the control which has changed via property node, just make sure to uncheck the "Block UI thread while handling Events" or whatever that terrible default option of the Event Structure is called.....

Message 16 of 16
(252 Views)