|
-
Mar 24th, 2008, 08:11 PM
#1
Thread Starter
Addicted Member
VB 6.0: Larg Array on hard disk - troubles with and questions on limitations
I'm having trouble coming up with a prototype program to store and use a 1,000,000,000 x 1,000,000,000 size array using the long data type.
Some information. Please correct me if I'm wrong.
- I need to be able to set, store, and read 1,000,000,000,000,000,000 elements . Yes, that’s allot, but it is what I'm trying to shoot for.
Using put:
- A long is stored as 6 bytes
- The record length can't exceed 32,767 bytes
-That gives us about 5000 elements per record
- There seems to be a limit of 2,147,484,647 records per file (because that is the limit of the Seek function)
- Can store up to 10,000,000,000,000 elements per file
-1000000000000000000 \ 10000000000000 = 100,000
- 100,000 files will be required to store the array??? Is this correct?
How many files can you have open at one time? I seem to get a memory error around the 500 mark.
Is there anyway to reduce the number of files needed? - Maybe just use one big file?
Any help would be great as I'm not used to working around the limits of VB 6.0 .
-
Mar 24th, 2008, 08:43 PM
#2
Re: VB 6.0: Larg Array on hard disk - troubles with and questions on limitations
You will have to find a different method. Do you realize how large that equates to? By the way: Long = 4 bytes, not 6.
If I understand you correctly ...
1 GB = 10^9 or 1 with 9 zeros, your requirement has 18 zeros
1 TB (Terabyte) = 10^12 or 1,000 GB; not there yet
1 PB (Petabyte) = 10^15 or 1,000 TB; not there yet
1 EB (Exabyte) = 10^18 or 1,000,000,000 GB; there we go & multiply it by 4 since you want to store Longs.
I know my hard drive isn't nearly that size. I believe this question is regarding a gameboard? I don't know what to say, other than you will have to think about different methods, and obvioulsy nothing nearly that size.
Last edited by LaVolpe; Mar 24th, 2008 at 08:51 PM.
-
Mar 24th, 2008, 09:52 PM
#3
Re: VB 6.0: Larg Array on hard disk - troubles with and questions on limitations
Tontow, divide and conquer. I doubt you will require all the possible paths as some are dead ends and other are simply part of longer paths. You need to rethink or redesign the algorithm in order to disregard/discard most of the paths and make the data size more manageable. Make it race specific, tech specific, make it goal (paths to end-point) based, etc.
Also, there should be a distinction on data processing and data display/representation or go for an n-tier application design that can reuse layouts and layout drawing algorithms (have you considered a treeview?). This is because you mentioned in your previous threads that the drawing of the lines (flowchart) is taking up too much processing time when it should be a straightforward and short process.
Last edited by leinad31; Mar 24th, 2008 at 09:56 PM.
-
Mar 24th, 2008, 11:04 PM
#4
Thread Starter
Addicted Member
Re: VB 6.0: Larg Array on hard disk - troubles with and questions on limitations
MSDN on the Put statment:
If the variable being written is a Variant of a numeric type, Put writes 2 bytes identifying the VarType of the Variant and then writes the variable. For example, when writing a Variant of VarType 3, Put writes 6 bytes: 2 bytes identifying the Variant as VarType 3 (Long) and 4 bytes containing the Long data. The record length specified by the Len clause in the Open statement must be at least 2 bytes greater than the actual number of bytes required to store the variable.
6 bytes, or is that only for the first recored in a Long type array?
But, yes. I do think that I need take a different approch.
Hmm, maby I could use something similar to the game board approch.
-
Mar 24th, 2008, 11:36 PM
#5
Re: VB 6.0: Larg Array on hard disk - troubles with and questions on limitations
@Tontow, you talk about subtype Long of data type Variant, each Variant (Long) value needs 6 bytes.
I think Lavolpe wants to say about Long data type, and yes, each Long value needs 4 bytes.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|