Yes I see what you mean. I guess my example is not good but I'd hoped the intent would be clear. Here's a new example.
I had added the () in an attempt to make it run though I do understand that's how you dynamically call a function.
Code: Select all
q::
{
xl:=ComObjActive("Excel.Application")
str := "xl.Selection.Address"
MsgBox, % "1." xl.Selection.Address ;Control test - expected result = $A$1
MsgBox, % "2." str ;Shows xl.Selection.Address, but not the expected result.
MsgBox, % "3." %str% ;Doesn't work at all, throws an error.
MsgBox, % "4." %str%() ;Returns blank; assume calling a method of a class that doesn't exist or maybe it does exist but it's dynamically created and essentially blank.
MsgBox, 5. %str% ;Same as 2.
MsgBox, 6. %str%() ;Same as 2 but with ().
return
}
Esc::ExitApp