Jump to content

Progress, FileReadLine


Recommended Posts

$F = FileOpen("1gb.txt", 0)
$total = FileGetSize("1gb.txt")
$count = 0

While 1
    $line = FileReadLine($F)
    If @error = -1 Then ExitLoop
    $count = $count + StringLen($line)
    ToolTip(Round(($count/$total)*100) & " % complete")
Wend

FileClose($F)

TrayTip is SSSLLLOOOWWWW

What do you think of my first attempt ? (I just tested on a 650kb file, hehe, a lot of overhead to calculate the percentage and string length for each line)

EDIT: I'm doing timed tests and the tooltip+Round line is also waaaayyyy too slow ... I hope the update of the progress bar element will be quicker than Tooltip

Edited by Inverted
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...