Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Out of Memory...
#1
Reading over the forum here, it's pretty clear that I'm a newb, by comparison to a lot of you, so I apologize if this question belongs more in the newby help forum, but this seemed like the right place to put it. In any case, here's what I'm hoping you can help me out with.

I've been working on a program to reprocess the files generated by one of the applications I use at work, and clean them out -- the details of that aren’t really relevant, but just for context -- and it calls upon me to use arrays much larger than those I've used in the past. That's all fine and good, in theory, but I'm receiving an Out of Memory error when I attempt to run the program from the run>start menu in the IDE. Below are my type and variable declarations. The error is generated on the line 'DIM nChunks(250) AS Chunk'

Code:
'$DYNAMIC

TYPE Chunk
Tag AS INTEGER
File AS STRING * 200
Type AS INTEGER
Ground AS INTEGER
Building AS INTEGER
Width AS INTEGER
Height AS DOUBLE
Flag AS INTEGER
Pad AS STRING * 20
END TYPE

TYPE Place
Tag AS INTEGER
Name AS STRING * 170
TrnX AS DOUBLE
TrnY AS DOUBLE
TrnZ AS DOUBLE
RotA AS DOUBLE
RotX AS DOUBLE
RotY AS DOUBLE
RotZ AS DOUBLE
Chunk AS INTEGER
Cull AS INTEGER
Group AS INTEGER
Sky AS INTEGER
WaterHeight AS DOUBLE
WaterType AS INTEGER
IsKeep AS INTEGER
END TYPE

TYPE Group
Tag AS INTEGER
Name AS STRING * 126
END TYPE

TYPE Main
NumChunk AS INTEGER
NumPlace AS INTEGER
NumGroup AS INTEGER
NumProps AS INTEGER
NumWater AS INTEGER
NumTiers AS INTEGER
Keep AS INTEGER
END TYPE

TYPE File
Chunk AS STRING * 200
Place AS STRING * 200
Prop AS STRING * 200
Water AS STRING * 200
Portals AS STRING * 200
Collisions AS STRING * 200
END TYPE

DIM File(10000) AS STRING
DIM Chunks(250) AS Chunk
DIM Places(250) AS Place
DIM Groups(100) AS Group
DIM nChunks(250) AS Chunk
DIM LineCount AS INTEGER
DIM ChunkCount AS INTEGER
DIM PlaceCount AS INTEGER
DIM GroupCount AS INTEGER
DIM nChunkCount AS INTEGER
DIM cLine AS INTEGER
DIM Main AS Main
DIM FileList AS File
DIM LegacyTag(250) as INTEGER
DIM nFile(10000) AS STRING

Anybody know what I'm doing wrong, and how I can fix it? A simple solution would be my preference (if it's a choice between simple and efficient), but any information would be great. Thanks.
Reply
#2
You could try these memory routines.
esus saves.... Passes to Moses, shoots, he scores!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)