キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Delete Array Element Using Array Reference

解決済み
解決策を見る

Hello,

 

I am trying to figure out how to delete an element of an array using only the array reference. This is a 1D array that won't have very many elements, but the elements can be of any type (numeric, string, cluster, etc.). I can successfully add elements to the array, but cannot figure out how to implement delete.  Currently, I'm changing the "deleted element" value to 0 (or equivalent) and moving it to the end of the array. This isn't sufficient as I need the initialized size of the array to decrease when I delete an element. I've attached an image demonstrating the results I want.

 

The Delete From Array Function won't work because I only have access to the array reference. To my knowledge, I can only use Invoke Nodes and Property Nodes. I tried seeing if I could disable a singular element, but the disable and enable properties affect all array elements. I've also tried passing in a blank variant constant to the Value property of the control reference, but this didn't work. I've attached an image of this attempt and the resulting error message.

 

I have also attached an image of how I am successfully adding an element to the array.

 

Any ideas would be greatly appreciated!

0 件の賞賛
メッセージ1/3
2,600件の閲覧回数
解決策
トピック作成者justine97が受理

You can read the "value" property, use "delete from array", then write the "value" property. This is quite slow relative to using the terminals, but if you're not doing it frequently it should work fine.

メッセージ2/3
2,587件の閲覧回数

Gregory,

 

This worked perfectly - thank you!

 

Picture of solution attached if anyone is interested.

0 件の賞賛
メッセージ3/3
2,556件の閲覧回数