Qbasicnews.com
December 08, 2019, 05:55:44 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Out of Memory...  (Read 1226 times)
Bael
New Member

Posts: 1


« on: June 27, 2004, 02:10:49 PM »

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.
Logged
LooseCaboose
I hold this place together
*****
Posts: 981



« Reply #1 on: June 29, 2004, 01:16:18 AM »

You could try these memory routines.
Logged

esus saves.... Passes to Moses, shoots, he scores!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!