Results 1 to 5 of 5

Thread: VB 6.0: Larg Array on hard disk - troubles with and questions on limitations

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    172

    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 .

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    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.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    172

    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.

  5. #5
    Head Hunted anhn's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    3,669

    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.
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • If your question was answered please use Thread Tools to mark your thread [RESOLVED]
    • Don't forget to RATE helpful posts

    • Baby Steps a guided tour
    • IsDigits() and IsNumber() functions • Wichmann-Hill Random() function • >> and << functions for VB • CopyFileByChunk

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width