Default Base Object

Discuss the future of the AutoHotkey language
just me
Posts: 9575
Joined: 02 Oct 2013, 08:51
Location: Germany

Default Base Object

03 Dec 2016, 11:11

The examples in the v2 docs don't run with v2.0-a076 and v2.0-a077 (Error: This line does not contain a recognized action). Is it intended?
guest3456
Posts: 3469
Joined: 09 Oct 2013, 10:31

Re: Default Base Object

03 Dec 2016, 11:44

https://lexikos.github.io/v2/docs/Objects.htm#Default_Base_Object wrote: The default base may be accessed by using .base with any non-object value; for instance, "".base.
i guess the example "".base is no longer valid because of this:
https://autohotkey.com/v2/v2-changes.htm wrote: Variable names cannot start with a digit and cannot contain the following characters which were previously allowed: @ # $. Only letters, numbers, underscore and non-ASCII characters are allowed.
changing "". to dummyvar. works, but then you run into the next issue:

Code: Select all

empty_var.foo := "bar"       ; <-------- no object to invoke
because of:
https://autohotkey.com/v2/v2-changes.htm wrote: Error Handling

Expressions

An exception is thrown when any of the following failures occur (instead of ignoring the failure):

- An invocation fails because the target is not an object, or the method/property is not handled. For associative arrays, only a method call can cause this.

lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: Default Base Object

03 Dec 2016, 16:40

just me wrote:The examples in the v2 docs don't run
That is expected.
I wrote:A great many examples have not been updated.
Topic: Documentation updated
"" is clearly not a variable.

It is not recognized as a standalone action because of a change to the way quotation marks are handled. Note that " ".base doesn't work in v1 either. The problem is only with detection of what kind of action the line contains, not parsing of the expression once it is recognized as such. The simple workaround is to use ("") or 0.

I was aware of the problem and hadn't planned to fix it, but maybe I will.

To avoid the exception, you just need to return value.
just me
Posts: 9575
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Default Base Object

04 Dec 2016, 04:25

Thanks for the explanation.

Return to “AutoHotkey Development”

Who is online

Users browsing this forum: No registered users and 26 guests