Results 1 to 7 of 7

Thread: faster way of parsing binary variables?

  1. #1

    Thread Starter
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    faster way of parsing binary variables?

    VB Code:
    1. Dim B() As Byte, sFilePath As String
    2.    
    3.     sFilePath = "SOMEFILE"
    4.     Open sFilePath For Binary Access Read As #1
    5.       ReDim B(1 To LOF(1))
    6.       Get #1, , B
    7.     Close #1
    8.    
    9.     For i = 1 To UBound(B)
    10.         t1.Text = t1.Text & B(i) & " "
    11.         DoEvents
    12.     Next i
    I have pulled this code from here somewhere, but it runs very slow when I put the bytes in the textbox. Is there any way to make this process faster?
    thnx in advance
    Last edited by TheBigB; Jul 1st, 2006 at 03:37 AM.

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: faster way to add text to a textbox?

    How is this?

    VB Code:
    1. Open sFilePath For Input As #1
    2.       t1.Text = Input(LOF(1), 1)
    3.     Close #1

  3. #3

    Thread Starter
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    Re: faster way to add text to a textbox?

    sorry doesn't work for me.... it shows 3 chars for 1,5 mb file.... is the textbox to small?

  4. #4
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: faster way to add text to a textbox?

    Is MultiLine set to True for the TextBox?

  5. #5
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: faster way to add text to a textbox?

    I also assumed it was just Text were loading IAW your Subject. Is that true?

  6. #6
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: faster way of parsing binary variables?

    You;ve changed the Subject. So, what is the goal? - Bianry data?

  7. #7

    Thread Starter
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    Re: faster way of parsing binary variables?

    Sorry for all confusion, going to try to make it clear now:

    Yes, the textbox is set multiline. I guess the textbox is to small to handle 1,5 mb.
    Maybe variables would work, but how do I make an array of variables with the array as small as possible (filling variables to the max)

    What I'm doing is for a study making a simple compression, by finding the same variables together. The finding together is no problem, but putting it in lines.

    Does that make it clear?
    Last edited by TheBigB; Jul 2nd, 2006 at 06:20 AM.

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