How to use the text property window, how to declare default values for array property

Hello

I have two questions:

  1. When I create a (shared) property and click on it I got an editable text window like this:
    Bildschirmfoto 2022-03-13 um 11.30.58
    I always wondered I can write here in regard of the (shared) property?

  2. I would like to create a property as an array with default values. The problem: As soon as I declare it as array by adding (), I can’t set a default value. Do I have to set the default from outside like in the event of on opening a mask?
    Bildschirmfoto 2022-03-13 um 11.34.01

1 Like

You do not want to populate your array from App.Opening Event ? (for example)

You can alternatively create a Method to initialize your application environment and populate your array from there.
You call that Method from App.Opening…

1 Like

as workaround you could add a single string property and in a event you add this data string
to array by split method.

Window1.MyStringArray = Window1.MyStringData.Split(",")
or add a few entries at runtime with array function.
Window1.MyStringArray = Array(“a”,“b”,“c”,“d”)
or made a feature request :wink:

1 Like

Thanks for your answers which are telling me I didn’t do anything wrong and I have to assign the default programmatically somewhere else.

“Request a feature”: This is not even a feature, this should be standard. I don’t know any other programming language where I cannot set a default value for a variable on initialising. I already sent bugs which were ignored. Why should I waste my time and request features?

Regarding your first question “What can I write here ?”, you can type anything you wish. I use that place to document the property.

1 Like

And so you can for variables which are not arrays.

Which bugs were those? And what were their Feedback numbers so we can look and possibly add points to get them fixed quicker.

Ok, thanks to answer this. That implies it’s just a text window with no programming related effect.

I don’t think a bug needs to get “votes”, it just needs to get fixed. The vote feature is nice for new requests. I experience this a lot (not only here), so my motivation on reporting bugs and not taken serious as (paying) customer makes me acting that way.

What I really appreciate here is the forum and the great help.

OK, so forget the votes. The devs don’t necessarily read all messages here, so with a bug you do better to report it via Feedback.

I vote for that.

But, if you do nothing, your bug may stay until doomsday.

You only have to follow the Xojo rules, then pray, and the bug may be squashed.

Xojo doesn’t support that, by design.
You want to be able to initialize arrays that way.
You are requesting a new feature.
Submit a feature request.

2 Likes