Create nested class instance from variable
Posted: 02 Dec 2020, 06:55
Hello everybody
I want to create an instance of a nested class. The class name is given through a variable.
Generation of o4 fails as there is a dot in my variable name. How can I generate an instance of a nested class from a variable containing a dot?
Using Autohotkey V2.0.a122
Thanks in advance
hoppfrosch
I want to create an instance of a nested class. The class name is given through a variable.
Code: Select all
class a {}
o1 := a.new() ; Works
cn := "a"
o2 := %cn%.new() ; Works
class b {
class c {}
}
o3 := b.c.new() ; Works
cn := "b.c"
o4 := %cn%.new() ; !!!! Fails! "Variable name contains an illegal character"
ExitApp
Using Autohotkey V2.0.a122
Thanks in advance
hoppfrosch