How to Send F5 to TC from my program (see inside)
Moderators: Hacker, petermad, Stefan2, white
Sample AHK code:

Roman
Code: Select all
Loop, c:\*.*, 2, 1
{
Loop, %A_LoopFileLongPath%\*.*
{
FileGetTime, TimeStamp
FileDateList = %FileDateList%%TimeStamp%`n
}
Sort, FileDateList, R
RegExMatch(FileDateList, "^.*?\n", NewestTimeStamp)
IfNotEqual, NewestTimeStamp
FileSetTime, %NewestTimeStamp%
FileDateList =
}

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
MVV,
Tanks, I have done recursive programming, but not too much. Indeed results are amazing (code size).
Hacker,
Thanks for popping in and for the AHK routine.
I did "play" with AHK a long time ago (67yo) but stopped.
Seeing your compact code, I will consider returning to it... Tha point is that I really love Delphi...
Do I read correctly that there is a built-in function "NewestTimeStamp" ??? Unbelievable.
Tanks, I have done recursive programming, but not too much. Indeed results are amazing (code size).
Hacker,
Thanks for popping in and for the AHK routine.
I did "play" with AHK a long time ago (67yo) but stopped.
Seeing your compact code, I will consider returning to it... Tha point is that I really love Delphi...
Do I read correctly that there is a built-in function "NewestTimeStamp" ??? Unbelievable.
Hello eitang,
Glad it worked fine.
Roman
Glad it worked fine.

Not really, that is just the name of a variable I used.Do I read correctly that there is a built-in function "NewestTimeStamp" ???
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Hacker,
>> Not really, that is just the name of a variable I used.
OK. Coming from Delphi and not C familly, I have great difficulty with the very shortened code... I am used to declaring variables, so something like this:
is difficult to understand for me.
Anyway I made a little AHK program around tour routine that takes a folder and an extension as commandline params and does a lot more than my previous program...
Added an error message and default parameters, and changed your lines into:
Compiled into a stand alone EXE and shrinked with an EXE shrinker, it makes a great utility !
Many thanks.
>> Not really, that is just the name of a variable I used.
OK. Coming from Delphi and not C familly, I have great difficulty with the very shortened code... I am used to declaring variables, so something like this:
Code: Select all
RegExMatch(FileDateList, "^.*?\n", NewestTimeStamp)
is difficult to understand for me.
Anyway I made a little AHK program around tour routine that takes a folder and an extension as commandline params and does a lot more than my previous program...
Added an error message and default parameters, and changed your lines into:
Code: Select all
Loop, %1%\*.*, 2, 1 ; Folder
{
Loop, %A_LoopFileLongPath%\*.%eg_ext% : extension
*
*
}
Many thanks.
eitang,

Glad you're enjoying AHK and finding it useful. The Help file for AHK is one of the best Help resources for any program I have seen, it should be able to help you find your way round.
Roman
I am also coming from Delphi.Coming from Delphi and not C familly

Glad you're enjoying AHK and finding it useful. The Help file for AHK is one of the best Help resources for any program I have seen, it should be able to help you find your way round.
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
2Hacker
Please excuse me for a tech question: In the code you gave above
The line where you fill up the list:
is totally opaque to me... I presume that FileDateList is the name of the list (containing files*.* in the currently treated folder).
I don't understant how the = sign adds items ???
I understand that `n is newline, so also is a new item, but the = ??? how comes it is not += or something like that? I didn't find anything about adding to lists other than GUI, and you do not use GUI..
TIA,
Please excuse me for a tech question: In the code you gave above
Code: Select all
Loop, c:\*.*, 2, 1
{
Loop, %A_LoopFileLongPath%\*.*
{
FileGetTime, TimeStamp
FileDateList = %FileDateList%%TimeStamp%`n
}
Sort, FileDateList, R
RegExMatch(FileDateList, "^.*?\n", NewestTimeStamp)
IfNotEqual, NewestTimeStamp
FileSetTime, %NewestTimeStamp%
FileDateList =
}
Code: Select all
FileDateList = %FileDateList%%TimeStamp%`n
I don't understant how the = sign adds items ???
I understand that `n is newline, so also is a new item, but the = ??? how comes it is not += or something like that? I didn't find anything about adding to lists other than GUI, and you do not use GUI..
TIA,
MVV,
Thanks for the reply.
>> I guess mentioned line is an assignment,
Indeed, but an assignment (as I said in my Q. above) replaces the current contents. This list is a list of files in a directory, so can contain many lines. AHK has also a := assignment but it is not a sort of "add" items.
>> and it assigns concatenation
??
This may be true (I just started learning AHK yesterday...) but surprising.
>> in total it produces multi-line string with timestamps.
Indeed the 'n is a chr(13) [ and 'L is chr(10) ] so I understood the idea, but still, I don't understand the = <BG>
Thanks for the reply.
>> I guess mentioned line is an assignment,
Indeed, but an assignment (as I said in my Q. above) replaces the current contents. This list is a list of files in a directory, so can contain many lines. AHK has also a := assignment but it is not a sort of "add" items.
>> and it assigns concatenation
??
This may be true (I just started learning AHK yesterday...) but surprising.
>> in total it produces multi-line string with timestamps.
Indeed the 'n is a chr(13) [ and 'L is chr(10) ] so I understood the idea, but still, I don't understand the = <BG>
I would say it looks like this in Delphi:
Code: Select all
FileDateList := FileDateList + TimeStamp + #13;