Erroneous error message?

Report problems with documented functionality
Posts: 3642
Joined: 04 Jun 2014, 08:33
Location: Germany

Erroneous error message?

10 Dec 2019, 06:18


Code: Select all

MsgBox, "Hallo"
MsgBox,% "Hallo"
results in an error message with:
001: MsgBox,"Hallo"
002: MsgBox,"Hallo"

I miss the percentage sign that forces an expression in line 002.
User avatar
Posts: 348
Joined: 11 Aug 2016, 02:32
GitHub: lmstearn

Re: Erroneous error message?

12 Dec 2019, 22:55

In the error is:
Error: Missing "{"

001: MsgBox,"Hallo"
002: MsgBox,"Hallo"
---> 003: Switch
004: Exit
005: Exit
005: Exit

The program will exit.
It's the same error if the % is omitted. Switch wants the cases: wrote:Switch SwitchValue
Case CaseValue1:
Case CaseValue2a, CaseValue2b:
:arrow: itros "ylbbub eht tuO kaerB" a ni kcuts m'I pleH
just me
Posts: 7404
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Erroneous error message?

13 Dec 2019, 06:19

IMO, the script parser removes the force-an-expression % signs when the line is executed and stored in the most-recently-executed buffer.

Code: Select all

ToolTip, "Hello"
ToolTip, % "Hello"
Var = % "Hello"

Posts: 7088
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: Erroneous error message?

08 Feb 2020, 00:06

ListLines and the error messages show a rough reproduction of the source code based on the "semi-compiled" state of the script. The text of each expression is kept, but the overall text of commands is not; it is reproduced from the command index and text of each parameter. Each parameter might have its original text (always excluding the force-an-expression sign) or might be derived from a variable name (for input/output variables).

It is not intended to be 100% accurate, but perhaps it is worth adding the % prefix for expression parameters. Whether or not the prefix was originally used is not stored anywhere, so parameters that are expressions by default would either always or never have the prefix.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 3 guests