Array with FSeek

Hello,

I have an array, but each element has a specific offset. Because of that my code looks way more boilerplate that simple array.

Instead of:

int myArray[numArray];

I have to write:

local uint i;
for (i = 0; i < numArray; i++) {
    FSeek(ofsArray[i]);
    int myArray;
}

After that in results all arrays are shown as seperate entities and are not grouped.

If I want them to be grouped I have to make them into seperate struct:

struct {
    local uint i;
    for (i = 0; i < numArray; i++) {
        FSeek(ofsArray[i]);
        int myArray;
    }
} myArray;

It is grouped now. But after that in results there is no number how many myArrays are there. Because technicaly it is only one struct.

And if I want to acces any element now, I have to write

myArray.myArray[0];

Does any one has any sugestions to this?

Your code is probably the best way to deal with an array like this. Our only suggestion is that if you wanted to see the number of elements in the array without having to open the struct, you could create a custom <read> function that displays the number of elements. If you are interested in this we can provide you with some sample code. Cheers!

Graeme
SweetScape Software

Thank you for your answer. Your suggestion could be usefull!