Jump to content
Sign in to follow this  
AlmarM

FileOpen with progress bar?

Recommended Posts

AlmarM

Hi,

Is it possible to display a progress bar with FileOpen?

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.

Share this post


Link to post
Share on other sites
AlmarM

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.

Share this post


Link to post
Share on other sites
trancexx

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

Share this post


Link to post
Share on other sites
AlmarM

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.

Share this post


Link to post
Share on other sites
trancexx

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

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.