Redim Reserve statement

Hi,
Any equivalent of Redim Preserve() in xojo ?
Unlike Redim Preserve () , RealBasic kept dim() and Redim() for compatibility with Vb6 …
in other words, any solution for Redim Preserve ?

[quote=488405:@Djamel AIT AMRANE]Hi,
Any equivalent of Redim Preserve() in xojo ?
Unlike Redim Preserve () , RealBasic kept dim() and Redim() for compatibility with Vb6 …
in other words, any solution for Redim Preserve ?[/quote]

If Preserve keeps the existing array content as much as possible, then that is the default DIM behavior in Xojo , at least for 1D arrays (Don’t know about multi-dimensional)

-Karen

I didn’t know about this either, so I looked it up.

https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/redim-statement

It seems that keyword will prevent you from resizing any dimension other than the last one, and I’m not aware of any similar keyword in Xojo.

In either case, the data itself is preserved, but it looks like that’s true in VB too.

[quote=488420:@Kem Tekinay]I didn’t know about this either, so I looked it up.

https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/redim-statement

It seems that keyword will prevent you from resizing any dimension other than the last one, and I’m not aware of any similar keyword in Xojo.

In either case, the data itself is preserved, but it looks like that’s true in VB too.[/quote]

Redim Preserve still exist in Vb.Net as shown , behavior must be same as Vb6.
If understood Karen Atkocius, DIM statement is default behavior in xojo.

seems it is just Redim with a new size
Redim
and in newer syntax it is .ResizeTo
or if you get out of bounds use .AddRow

[quote=488445:@Markus Rauch]seems it is just Redim with a new size
Redim
and in newer syntax it is .ResizeTo
or if you get out of bounds use .AddRow[/quote]
Yes Markus, i discover this in newer 2019r1, since my lisence is from 2015r1.