Jacemdom Posted December 7, 2017 Report Share Posted December 7, 2017 Just wanted to share this. Not sure if this is the best place but better then nowhere! fvi_lib_array_element_last_get.vim 1 Quote Link to comment
gleichman Posted December 7, 2017 Report Share Posted December 7, 2017 Nice example of a VIM. I'm finding VIMs to be very useful. I think they be the best new LabVIEW feature since the event structure. Quote Link to comment
hooovahh Posted December 7, 2017 Report Share Posted December 7, 2017 There already is a primitive that does this. The Delete From Array returns the last element in the array if nothing is wired to the length and index. There was a thread on LAVA years ago about which was a faster method, and a few versions of LabVIEW the method you showed was faster, but in most the delete from array is faster. And it already has a quick drop dfa. 1 Quote Link to comment
infinitenothing Posted December 7, 2017 Report Share Posted December 7, 2017 It's a personal preference but I don't like using delete array for that purpose because I think it's confusing. I'm sure it costs me a few milliseconds when I see it and think "why would I want to delete an element from that array?" We want code that's easy to read not easy to write right? Quote Link to comment
hooovahh Posted December 7, 2017 Report Share Posted December 7, 2017 I get your point, and there is large amounts of debate over similar topics. Should I not use Variable=Variable++ since not all developers know this is short hand for incrementing a variable? To me the delete from array with nothing wired is used for getting the last element, but I get not everyone associates this function with that feature. But I suppose if you really feel strongly about this you could make a VIM that just has this one primitive in it. Quote Link to comment
crossrulz Posted December 9, 2017 Report Share Posted December 9, 2017 (edited) On 12/7/2017 at 8:31 AM, hooovahh said: There was a thread on LAVA years ago about which was a faster method, and a few versions of LabVIEW the method you showed was faster, but in most the delete from array is faster. And it already has a quick drop dfa. Thread in question. Once the stomping was fixed in the Delete From Array (supposedly in 2014), that became a lot faster than any other method. Edited December 9, 2017 by crossrulz Quote Link to comment
drjdpowell Posted December 9, 2017 Report Share Posted December 9, 2017 A “last element” VIM would be clearer than using “delete”, as it could have an icon that suggests the last element I use a “first and last element” VIM because I often need both to determine ranges. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.