Huge arrays - around 46233 elements
Jeffrey Fielding writes:
> put it into a constant in the program. When I run the program, it says "sub
> program too large" or something like that. It didn't even get to the code
> yet! Anyway, the whole program was about 49,000 lines. Is this because I am
> using the Public Domain Edition or does Euphoria not support such large
> arrays (about 46233)? Could I store this info in a file and then read it
> when the program loads?
There is a (large) limit on the size of the "top level" code, and there
is a (large) limit on the size of any one subroutine. You can have as many
subroutines as you like however. It sounds like your huge constant
declaration caused you to exceed the limit on the "top level" code.
There's no difference between the Public Domain and the
Complete Edition in this regard.
I would recommend that you store the data in a separate data file and
read it in. You could even open() your existing file and, with some minor
modifications, read in all the numbers with a single get(). Euphoria
supports sequences with millions of elements
(provided you have enough memory).
If the numbers are all between 0 and 255 you could store one number per
byte in a file, and read them in with getc(). This would give you
a much smaller file that could be loaded much faster.
Regards,
Rob Craig
Rapid Deployment Software
|
Not Categorized, Please Help
|
|