Sometimes in quotes, sometime not

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jkeks
Posts: 60
Joined: 20 Oct 2019, 00:24
Contact:

Sometimes in quotes, sometime not

Post by jkeks » 20 Nov 2021, 09:55

Code: Select all

if !FileExist("counter.txt")
 FileAppend, 0, counter.txt
Where is logic ?
Why in first case we need to use quotes
second time not

gregster
Posts: 9111
Joined: 30 Sep 2013, 06:48

Re: Sometimes in quotes, sometime not

Post by gregster » 20 Nov 2021, 09:59

First one is a function (which always requires expression syntax), second one is a command.
https://www.autohotkey.com/docs/Concepts.htm#functions wrote:In essence, functions and commands are the same thing, so the concepts explained here apply to both. However, the long history of AutoHotkey v1 and an emphasis on backward-compatibility have resulted in a divide between commands, which require legacy syntax, and functions, which require expression syntax.
Btw, AHK v2 tries to bridge this duality by focusing on functions, and giving up backwards compatibility.

Post Reply

Return to “Ask for Help (v1)”