- @Flipeador:
Code: Select all
Func1()
{
return True ;ambiguous (unless you already knew that in AutoHotkey, True = 1)
}
Func2()
{
return 1 ;unambiguous
}
- @john_c: Btw I would call the variable 'Dir', not 'DirName'. I think that 'dir name' is ambiguous, e.g. for 'C:\Program Files\AutoHotkey', I would say that 'AutoHotkey' is the dir name.
- Of the following two versions, which do people prefer?
Code: Select all
checkIfDirExists(Dir)
{
if (InStr(FileExist(Dir), "D"))
return 1
else
return 0
}
checkIfDirExists(Dir)
{
if (InStr(FileExist(Dir), "D"))
return 1
return 0
}
- Here is what I have for a DirExist backport using Coco's coding style. Part of 'AHK v2 functions for AHK v1'.
Code: Select all
DirExist(FilePattern)
{
local AttributeString := FileExist(FilePattern)
return InStr(AttributeString, "D") ? AttributeString : ""
}
- Here is a function I wrote in the past.
Code: Select all
JEE_IsDir(vDir)
{
return !!InStr(FileExist(vDir), "D")
;return !!DirExist(vDir)
}