Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the comma after a command do?

Tags:

autohotkey

The AutoHotkey Beginner Tutorial starts off with an example using the Send command, with the command and its argument separated by a comma:

^j::
   Send, My First Script
Return

...

SEND is the command, anything after the comma (,) will be typed.

Later, it gives an example of the MsgBox command with no comma:

esc::
    MsgBox Escape!!!!
Return

Experimentally, it seems that including or omitting the comma makes no difference to the behaviour of a command, at least in these simple cases. We can change whether the comma is included in both examples above and the command still works: MsgBox, Escape!!! works, and so does Send My First Script.

Are there circumstances in which the syntax requires the comma (or forbids it)? Does the inclusion of the comma alter the semantics of the command in any way? Why are both syntaxes allowed?

like image 870
Mark Amery Avatar asked Nov 10 '17 12:11

Mark Amery


People also ask

What does a comma mean in SED?

It specifies a RANGE over which to apply the d command. Ranges can be specified with patterns like this: sed -e '/START/,/END/ command' # apply command on lines between START and END pattern.


1 Answers

The comma (,) in AutoHotkey is a separator. The first (between the command and the first parameter) is completely optional in most circumstances:

Tip: The first comma of any command may be omitted (except when the first parameter is blank or starts with := or =, or the command is alone at the top of a continuation section). For example:

MsgBox This is ok.
MsgBox, This is ok too (it has an explicit comma).
like image 92
Nepho Avatar answered Sep 28 '22 18:09

Nepho