Control Array - Removing a control

Hi guys, me again :smiley:

so I have some code that reads in from a realsql database and then produces lines based on the information in the database (database contains the x1, y1, x2, y2 details)

so when the program opens up it reads on from the database and uses a control array ( property; l(-1) as line) and adds a new line to l for all the rows in the database

Now that i have finally got the deletion of a row working what i need to do now is delete the line associated with that row (or delete all the lines and redraw them if thats easier?)

but I have absolutely no idea how to delete them :smiley: could someone please point me in the right direction? I am currently looking through the language guide but not finding much


I guess i could always hide the line? but that would still leave it in the program until the user closes the app and reloads it

I’ve read this a couple times, but I don’t understand what you are doing.

If you have a control set (which haven’t been called control arrays since 2013), then you remove things by calling the Close method. So MyControl(2).Close, for example. But control sets are not declared by having a property like you showed, so I don’t know what you actually have.

If you have an actual array, then you can remove elements by using the Remove method, MyArray.Remove(2).

thank you for the reply

I have a property added to window1 which is;

l(-1) as line

and then for each row of the database i have;

l(a)=new line1

where line1 is a line i have on window1 with an index of 0 set and a is the row in the database (index on each time)

I have just tried l.remove(3) and the line remains


I have just run the close and that has worked :smiley:

Thanks :smiley:

Since you have both an array and a control set, you will need to do both: close and remove.