A_LoopFileLongPath does not save into memory

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

A_LoopFileLongPath does not save into memory

22 Sep 2015, 01:57

Why the results are different: 2000 vs 0?

Code: Select all

Start := A_TickCount
Loop, Files, C:\*.exe, R
{
   loop 10000
      a := A_LoopFileLongPath
   break
}
msgbox % A_TickCount - Start

Start := A_TickCount
Loop, Files, C:\*.exe, R
{
   loop 10000
      a := A_LoopFileFullPath
   break
}
msgbox % A_TickCount - Start
lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: A_LoopFileLongPath does not save into memory

22 Sep 2015, 02:30

The results are different because A_LoopFileFullPath does "save into memory"...

A_LoopFileLongPath is basically GetFullPathName(A_LoopFileFullPath). It queries the file system each time. If you don't want that, don't retrieve it more than once per file.
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: A_LoopFileLongPath does not save into memory

22 Sep 2015, 02:36

Thank You! Now I understand.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: bobstoner289, JnLlnd and 207 guests