1

Topic: To delete by turns objects in an array

Children prompt as to delete by turns the last objects in an array, the example put

2

Re: To delete by turns objects in an array

Redim Preserve

3

Re: To delete by turns objects in an array

Shocker. Pro, not clearly! Produces an error

4

Re: To delete by turns objects in an array

Shocker. Pro, at me in the project is deleted objects so

Unload Text2 (T)

but that is deleted last and penultimate produces an error...

5

Re: To delete by turns objects in an array

And in procedure Command3_Click after outswapping who will decrement counters, Pushkin?

6

Re: To delete by turns objects in an array

And generally these counters - superfluous. It is possible directly Load Ctrl (Ctrl. Count) and accordingly Unload Ctrl (Ctrl. Count-1)

7

Re: To delete by turns objects in an array

Akina, whether correctly I understood?

Unload Text2 (T - 1)

so and that it gives to me, removal of a penultimate line instead of last!

8

Re: To delete by turns objects in an array

How think, to that at you it will be equal  at the second, third successively button click Command3?

9

Re: To delete by turns objects in an array

Shocker. Pro, produces an error that such object is not present

10

Re: To delete by turns objects in an array

So to that it will be equal  at the second, third successively button click Command3?

11

Re: To delete by turns objects in an array

assei , well here, say, at you 4 objects, =3. You deleted this object. And  on former 3. The stub is clear at the following attempt of removal you will go to a distance foggy, because now objects only 3 with numbers from 0 to 2...

12

Re: To delete by turns objects in an array

Akina wrote:

to decrement counters

the first time I hear

13

Re: To delete by turns objects in an array

assei;
from that is you the code wrote? Or somewhere  also you do not understand, how it works?

14

Re: To delete by turns objects in an array

Shocker. Pro,

' it is
Public T As Integer
T = Text2.Count
Load Text2 (T)
Text2 (T) = ""
' it should be torn off
Text2 (T).Top = Text2 (T - 1).Top + 60 + Text2 (T - 1).Height
Text2 (T).Visible = True
' it is itself understood that with it to do
Unload Text2 (T)

15

Re: To delete by turns objects in an array

But the code in the beginning you sent another.

assei wrote:

Unload Text2 (T)

this code will delete  with an index which value lies in .
That is if you there supposed 3 it and will delete  with an index 3, understand?

16

Re: To delete by turns objects in an array

Shocker. Pro, I simply simplified it, all began to write, as in the project is and Label ()

17

Re: To delete by turns objects in an array

Without a difference, an error in the same
Removal in that code at you in separate procedure is simple

18

Re: To delete by turns objects in an array

Shocker. Pro, it turns out I will delete only the last index , be it that 6 or 12

19

Re: To delete by turns objects in an array

assei wrote:

Shocker. Pro, it turns out I will delete only the last index , be it that 6 or 12

yes

20

Re: To delete by turns objects in an array

Shocker. Pro, whether correctly I understand that I should work with an array and a cycle?

21

Re: To delete by turns objects in an array

What for? You need to delete the last element? So delete the last.
How to calculate an index of the last? Well you calculate it at adding of the next element. Here in the same way at removal.

22

Re: To delete by turns objects in an array

Shocker. Pro, I understood that it is necessary to make, I sit I think, while it turns out to delete at once on two........ I will think

23

Re: To delete by turns objects in an array

Shocker. Pro, at me THANKS FOR the HELP turned out

24

Re: To delete by turns objects in an array

, the help gave Akina even in the morning

25

Re: To delete by turns objects in an array

Shocker. Pro to decrement!!!!!!!!!!