Can't create arrays larger than 0x7fffffff bytes

I’m trying to define a huge block of data in a media file, but 010 gives me the error

*ERROR Line 577: Invalid array size in declaration.

if the array size is > 0x7fffffff. That’s not unexpected, but it IS inconvenient. I can hack around it by defining a bunch of contiguous arrays, but it’d be nice if that wasn’t necessary.

You are correct that there is currently a limit of 0x7fffffff for array sizes. We will look at this and see if there is any way we can increase the limit for one of our next releases. You will have to use blocks for now and let us know if you need any help getting it to work. Cheers!

Graeme
SweetScape Software

If you don’t need the data to be expandable or accessible, you could use struct{} data<size=...>.

Other than that, you could always create a struct with a size argument like so:

struct Array;
struct Array(int64 size) {
    if (size <= 0x7FFFFFFF) {
        ubyte data[size];
    } else {
        for (size; size > 0; size -= sizeof(chunk)) {
            Array chunk(Min(size, 0x7FFFFFFF));
        }
    }
};

It’s a bit of a hack, but it works (and can also be re-purposed for an 8-bit 2D array, too).

This is nice suggestion. I’ll see how it looks in the template output. I don’t really care if it’s expandable, since it’s actually eliding more verbose data structures in order to make processing more timely.

Once the fix for the large array selection is published (it’s a different bug report), I think all the issues for my template will be fixed.