Yes, that’ll work. It’s just not pretty. I like nice code.
Thanks for the code.
Okay, we agree on that. I was hoping I had overlooked something. It would be too easy if array() simply worked without parameters. But let’s be honest, it’s a Xojo feature (not a bug) that I just don’t understand and after all, there is a workaround…
I don’t need that, and I don’t want that. There are simply situations where Xojo gives me that back.
If it is Nil you could not do .count()… But even if you could, that qould not change anything, because there is no problem finding out if the array is nil. The problem is to return it back to a functioning state.
Yes, thank you. Now we are at the “what workarounds can we find” level. To be honest, I can think of a few variants myself. I just don’t like workarounds and I was (once again) hoping that “it must work out of the box”
But my question was how to get an empty array in a “proper” way without having to create one
It has simply become completely normal here in the forum for some people to immediately help with a workaround for every problem.
That’s the real problem, you create workarounds all day long.
But there would be no need for a workaround if (as in other languages I know) you could simply make a variable = array().
My hope was that someone would say: Sure it works, you just overlooked the function XYZ.
I am very pleased that you wanted to help! It’s just a difference whether I’m looking for a workaround to be able to continue working, or whether I just wanted confirmation that I haven’t overlooked anything