Size only array declaration - Use default 0-based index?

Hello, I had a question about declaring arrays. Is there a way to simply declare an array with a size and let the compiler use the default lower bound of zero (per #12988)? Something like:

var a: [10000] real;

Such that the range is 0..9999? But maybe because that single integer value is not a valid range it's not possible. I ask because it'd be neat to be able to just use the default 0-based index without having to repeatedly and explicitly specify it ([0..#10000]) throughout a codebase.

You can specify a range

const R = 0..#10000;

and then use that range throughout the codebase

2 Likes

Thanks so much! With this I can parameterize a simple 1-line procedure to initialize such arrays on the fly.

1 Like