Jump to content

Can This Be Faster?


Recommended Posts

$Handle = FileOpen("ASCII.txt",16)
$Read = FileRead($Handle)
$NEWFILE = ""
_TOBinary($Read)
Func _TOBinary($Read)
for $i = 1 to StringLen($Read) step 3
    $Mid = StringMid($Read,$i,3)
        if $Mid > 255 Then
            $i -= 1
            $Mid = StringMid($Read,$i,2)
        EndIf
    $NEWFILE &= Chr($Mid)
Next
FileWrite("Binary.txt",$NEWFILE)
EndFunc

Its still running and its more than 3 hours now for a 1mb file...

Edited by CrypticKiwi
Link to comment
Share on other sites

If you reading as binary you can use BinaryMid instead stringmid. It's faster.

 

Saludos

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...