Load File BinaryStream into Arrays?

is it possible to load a file for example an index in a memory table without having to make a loop that can be very slow…

exemple : file binaryStrem load to Tableau(x,9), in one reading block

It depends on how the file is laid out, what kind of data you are loading (e.g., string vs. Int32 vs. Double), and whether it’s a single-index array or (as in your example) a multi-index array.

It also depends on whether you have control of the file format.

So the short answer is, maybe.

for example, one

arrays(x,9) as Unit32

create by the application itself

i know for string it’s probably not possible…

ps : thank you for your answer :wink:

if so how do I do, what would the code be?

If you want a multi-dimensional array, you have to loop. If you can control the format of the file, store it as JSON so you can quickly parse and loop through it.

damage that you can’t have the array pointer and load a file with the same structure format… if I understand that is not possible? i’ll see for the JSON… Thank you, but for a table with a dimension it’s possible to be? if so, how do I do it? an example of a code?

Xojo’s arrays, like many other object oriented frameworks, aren’t a contiguos block of bytes containing array elements.
You can create a C like array using memoryblock and access elements using index/offset or pointer but is up to you to write code in C/asm like fashion.

okay, I’ll stick to loops, so :wink:

thx :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.