Declaring initial values for a Property that is an array

I created a property for Window1 called my_array()

How do I declare the initial values?

When I click on the property I see the inspector panel and I also see a white box. I can put text in the white box. I tried several syntax variation but they dont work. I searched the LRM but could not find any hints

my_array = array(“a”,“b”,“c”,“d”)

Putting your code in the window open event should fill your array. I’m not sure that you can fill an array at design time.

If it’s the same array for each window and it will never change, consider making it a Shared Property, then fill it in the Window’s Open Event like this:

if my_array.Ubound = -1 then
  my_array = Array( … )
end if

What I have been doing so far is that I created an activate event on the application. Then inside of that I initialized my array. I wanted to see if there was a better way

Activate is not the place for that. Every time the app moves from the background to the foreground, your array will be re-initialized. I think you want the App.Open event.

If the array is truly meant for windows only, use Window.Open to initialize it as a property of the window (or, as I mentioned, a Shared Property). If it’s truly meant to be global, consider creating a Globals module and adding an Init() method to it that you will call from App.Open.

try in open event
dim my_array(-1) as String
my_array = split(“a b c d”)