Jump to content

FileOpen with progress bar?


Recommended Posts

You mean to display the progress of reading the file into memory or something?

I mean when the users pressed the button (... to browse), selects a file and presses ok.

When the user pressed Ok so the fileopendialog closes the FileOpen starts.

If the FileOpen has been started the progress bar should start (showing the %).

Get it?

AlmarM

It should display the progress of reading the file.

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

It should display the progress of reading the file.

This goes off topic but...

There are some things that should be done as fast as possible (and faster). Reading files is surely one of those.

Why would you want to slow things down (to see the progress)?

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

This goes off topic but...

There are some things that should be done as fast as possible (and faster). Reading files is surely one of those.

Why would you want to slow things down (to see the progress)?

Hmm... Looks cool ^_^

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

You should have said that earlier. That's a good reason ......not

Like this maybe:

Opt("MustDeclareVars", 1)

ProgressOn("Reading File", "Reading", "", 100, 100)

Global $sFile = @ScriptFullPath

Global $iSize = FileGetSize($sFile)
Global $iChunkSize = Ceiling($iSize / 20)

Global $hFile = FileOpen($sFile, 0)

Global $sRead

For $i = 1 To 20

    $sRead &= FileRead($hFile, $iChunkSize)

    If @error Then
        ExitLoop
    EndIf

    ProgressSet(5 * $i, 5 * $i & " percent")

    Sleep(50)

Next

FileClose($hFile)
ProgressSet(100, "Done", "Complete")

ConsoleWrite("! " & StringLen($sRead) & "  " & $iSize & "  " & $iChunkSize & @CRLF)

Sleep(500)

ConsoleWrite($sRead & @CRLF)

ProgressOff()

♡♡♡

.

eMyvnE

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...