I declared this as part of a window but I’m getting this error:
CardReview.StyRuns(kCSorce,) Declaration
Syntax error
StyRuns(kCSorce,) As StyleRun
kCSorce is a constant.
Apparently I cannot define a multi-dimensional array as a property WITH a constant.
It’s been a while since I’ve used this, since I now use classes.
I also cannot just declare an array CardReview.StyRuns(,) As StyleRun
I know I did this before and also used constants in the property declaration
Note how the , for another dimension is followed by another sizeN which itself is not in a [ … ] block. Thus the sizeN is not itself optional. If you add a , for another dimension, you must also supply a size value. The size value itself is described as:
You pass as many size parameters as dimensions in the array. The size parameters must be numbers or constants.
So if you don’t know the size value to use as compile time, supply -1 either in the code itself or as a constant which is set to -1 if you consider that more readable.
Doug. I am not disputing what you are stating. What I am stating is XOJO is becoming consistent. For many years, I didn’t need to include a number in a declaration.
I could write
Dim anarray( , , , ) As string and it would work.
BTW. How do I quote a previous statement in a conversation?
It’s not in the FAQ
Did you mean beocming inconsistent? Becoming consistent sounds to me like a good thing. And personally I do not mind having to specify -1 (or a constant) to make it clear another dimension was intentional.
What I do is simply highlight text in the original message, then you get a floating button that appears which says "Quote
Simply click that and it will start a new reply with the text quoted. Or if already in a reply, you can add another quote by repeating the process and highlighting more text in the original thread.
I think your memory is playing tricks on you. In a Dim statement, you have always needed to specify a value or -1. Now when you specify an array as a parameter of a method, then you can omit the size.