 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
JimH
Joined: 11 Jan 2008 Posts: 1 Location: Papua New Guinea
|
Posted: Mon Jan 14, 2008 2:50 am Post subject: Help file misleading for newbie re Loop (files & folders |
|
|
Great program -- very powerful
But as a newbie I found something misleading in the last example in the help page on
Loop (files & folders)
I copied the whole example into a script and dropped some folders onto it.
The variable LongPath was always blank
Here's the example:
| Code: | ; Example #6: Convert filenames passed in via command-line parameters to long names,
; complete path, and correct uppercase/lowercase characters as stored in the file system.
Loop %0% ; For each file dropped onto the script (or passed as a parameter).
{
GivenPath := %A_Index% ; Retrieve the next command line parameter.
Loop %GivenPath%
LongPath = %A_LoopFileLongPath%
MsgBox The case-corrected long path name of file`n%GivenPath%`nis:`n%LongPath%
}
|
I didn't try dropping any plain files on the script, or I would have seen why.
I looked at some other examples people had posted, then read the documentation more carefully, and realised I needed to change
Loop %GivenPath%
to
Loop %GivenPath%, 1
to make it not ignore folders.
Can I suggest that the script in the help file be modified the same way, or that the comment at the beginning of the script be changed from
Example #6: Convert filenames passed in
to
Example #6: Convert filenames (of plain files, not folders) passed in
Hope this helps other newbies,
Jim |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Mon Jan 14, 2008 5:12 pm Post subject: |
|
|
I don't see an ambiguity (as we are not in Unix).
A filename is the name of a file, not of a folder.
If you have some evidence of otherwise, eg. somewhere in Microsoft's Web site, feel free to give the reference. Thanks. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|