03-07-2012 11:36 AM
I am wanting to know if you can delete an element from an array, index the deleted portion,
and update the value of Array to not include the deleted portion in a more direct way than the following:
Or, in my program, the array is initialized with certain indices which makes the task of removing an element from
the array, indexing the deleted portion, and updating the array to not include the deleted portion similar to the following:
a) Is there a way to do this without having to use Local Variables?
b) Should I be so concerned about ridding my program of all Local Variables? (even ones that don't create race conditions)
Solved! Go to Solution.
03-07-2012 11:46 AM
Keep the array in a globally initialized feedback node. Don't involve front panel objects.
03-07-2012 11:54 AM
03-07-2012 11:58 AM
"Keep the array in a globally initialized feedback node. Don't involve front panel objects."
I suppose I need to include the fact that this is happening in an event structure where this happens for different events, not for each iteration of a loop.
03-07-2012 12:04 PM
@goodnaysayer wrote:
I suppose I need to include the fact that this is happening in an event structure where this happens for different events, not for each iteration of a loop.
Same difference. Show us more code so we can be more helpful ;).
03-07-2012 12:19 PM
I don't mean to come off as being obstinate, but, since my code works using the method shown (and this is a very small part of the program), my main question is really:
"Is there a reason why I should take the time to do this another way?" (i.e. without using Local Variables in the way specified in the sample code provided)
03-07-2012 12:33 PM
Speed, memory usage and possibly avoiding race conditions. Learning better coding techniques is another good reason. But if it does what you need it to do then why bother. If you know how to use shift registers then you know how to use feedback nodes. They are kind of the same thing but without the loop.
03-07-2012 12:43 PM
Well, I suppose I will not worry about this then. I may come back to this in time -- this phase of the project will be fluid until summer.
If I do come back I now know to start by reading over feedback nodes.
Thanks for the help.
03-07-2012 12:58 PM
Feedback nodes are really cool things. Local variables - not so much
But seriously local variables do have their uses. This is just not the best use.
Also, Altenbach should get the solution. I answered a different question
03-07-2012 01:06 PM
If there were only a way to have multiple solutions.... I have a tendency to mark the solution of the last question instead of the initial...
Forgive me, Altenbach.
Forgive me, Steve.
Kudos all around.