Results 1 to 3 of 3

Thread: Using the Input func. is too slow !

  1. #1

    Thread Starter
    Registered User Lior's Avatar
    Join Date
    Jan 2000
    Posts
    307

    Post

    Hey...
    You know, If I have a file named "Lior.TXT" and its size is 1MB, to paste all the file into a string using the input function takes 8 seconds!!! (on my P500).
    I used this code:
    Code:
    Dim Buffer As String
    Open "C:\LIOR.TXT" For Binary As #1 
      Buffer = Input(LOF(1), #1)
    Close
    If LIOR.TXT size is 1MB, 8 seconds are requierd to finish the program!
    If its 2MB, 16 seconds Are requierd! (And so on..)

    Any Ideas So It Wont Take That Long?

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Post

    Use get instead
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Registered User Lior's Avatar
    Join Date
    Jan 2000
    Posts
    307

    Still doesnt work...

    Man...thanks for trying to help,
    But when I declare Buffer as String and replace the line:
    Code:
    Buffer=Input(LOF(1),#1)
    with this piece of code:
    Code:
    Get #1, ,Buffer
    The Buffer just gets nothing, I mean it gets "".

    Any Idead How To Use The Get Statement Correctly To Load All Of The File Opened In Binary Mode Into A String?

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