Jump to content

What goes faster?


Recommended Posts

Checking for FileDelete can also be done without checking FileExists()

If FileDelete("c:\some\file.ext") Then
    ;; Do something
Else
    ;; Do something else because the file was not deleted or did not exist.
EndIf

Edit: I should also make you aware of this.

Unless you are checking at least hundreds of files with FileExists() OR you are running an old 286 system with about 4Mb of RAM on Win 3.1, then the time saving will not be noticable. For example, the time it takes to check the existence of 30 files will be less than the time it takes for a blink of the eye. You're talking micro-seconds here.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Ok, thanks for the replys.

At the moment i'm trying to optimize my code, after getting it to work

the way i want.

I realized that some stuff could be put into functions, that gets accessed with

Call, only when needed.

Other stuff wasn't needed (shuffling the code around), so i stripped that away.

Any tips on optimizing is always nice.

Link to comment
Share on other sites

Avoiding call is a good start.

Why on earth would you want to use Call("myfunc", $sParam), when you can just use MyFunc($sParam)?

There are times when Call can be handy but normalally it's better to access a function by the second method.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Thanks !

I'm learning here.

As you can see, i still haven't got rid of the "goto" bug from bat scripting :idea:

GoTo and GoSub rode out on the back of a dinosaur and Call should have gone with them.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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