|
-
Apr 15th, 2000, 05:11 AM
#5
Thread Starter
Registered User
Thanks....But...
Hey again...
Thanks for trying to help me, but guys, thats not what I wanted. I already know how to load the whole file into a buffer with the Input function and also with the Get statement. I think I just didnt explain the problem well enough. So here is the problem well explained:
It will be easier to explain if I give a practical example.
So let's say I wanna encrypt some file, with a primitive method, let's say I'll take each byte and rewrite it as the next byte in the ASCII table.
Let's say I have this simple code:
Code:
Dim ByteRead as Byte
Open "Source" for binary as #1
Open "Target" for binary as #2
Do
Get #1, ,ByteRead
Put #2, ,Chr$(ByteRead+1)
Loop Until Loc(1)=lof(1) 'Until End Of File
Close
In this example we see that the time that will to the program to be completed is dependent on the source file size.
If the Source file size is 10MB so the program will do 10*1024*1024 loops ! too much time !
Now, If I wont read byte after byte as I did, and I will read 2K of data each time using the Get statement, *I still need to access each byte! and make a loop from 1 to 2048 *
So I will try to ask it in short:
How can the program processing time not be dependent on the file size?
In other words,
How can I access and change each byte in a file individualy,
without running a loop from 1 To FileSize ?
Thanks for any help,
Lior, An Israeli Programmer.
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
|