Hi all,
in this Code I missed a comma. When I run this test the result is catastrophic, Windows plays crazy.
#Warn
arr := [500, 400]
Click(arr[1] , 600) ; o.k.
Click(arr[1] 3) ; Missing comma
Is there any situation where this missing comma makes sense? Or should it not be warned?
(Sorry for my GermEnglish)
Missing comma
Re: Missing comma
Yes, the missing comma makes sense when you are building a single expression instead of attempting to create two expressions as different parameters. The documentation shows examples and includes one where the parameters are listed in quotation marks. You would find something similar with other functions.
Remember that functions use expressions rather than literal strings.
Since AHK v2 has no commands (just functions, aside from flow control), expressions are used at all times.
Explained: Concatenate
Remember that functions use expressions rather than literal strings.
Code: Select all
#Requires AutoHotkey v2.0
arr := [5, 4]
gui1 := Gui()
gui1.AddText(, arr[1] 3)
gui1.Show
Explained: Concatenate
And for Click:Concatenate. A period (dot) with at least one space or tab on each side is used to combine two items into a single string. You may also omit the period to achieve the same result (except where ambiguous such as x -y, or when the item on the right side has a leading ++ or --). When the dot is omitted, there must be at least one space or tab between the items to be merged.
ExampleOptions: Specify zero or more of the following components: Coords, WhichButton, ClickCount, DownOrUp, and/or Relative. Separate each component from the next with at least one space, tab, and/or comma (within a string or as separate parameters).
Re: Missing comma
Moin,
I see. Thank you for this detailed answer.
I see. Thank you for this detailed answer.