According to documentation, quotation: "$THIS contains the current class context.The class context for an instance method is the current object reference (OREF).The class context for a class method is the current classname as a string value." As my example below shows, either the documentation or the implementation (or both) is wrong, I always call a class method (Value) and expected the class name as the return value but got either the class name or an OREF. Moreover, if I repeat the call, I get another values. But why?Does anyone have a clear explanation (for an aging brain) or have I
I'm playing with %Net.DB.Iris and stumbled over a mystery
set con=##class(%Net.DB.DataSource).CreateConnection(host,...)
set srv=con.CreateIris()
write srv.ClassMethodValue("%SYSTEM.Util","InstallDirectory")
Entering the above lines (in a terminal session) on my local instance yields the correct answer for:
host = "localhost"
host = the real IP of localhost (i.e. host="192.168...")
host = "10.x.y.dev" customers development system (over a VPN tunnel)
but for
I'm in a very early phase of an project where some of the methods should be written in python. Occasionally, projects also have byproducts, I call them utility methods, because some of the methods the project uses can also be used in other applications too. I tend to put such methods in percent classes, so they can be used everywhere, independent of the namespace, where an application runs. I try to do the same in my current project too, merely with python it doesn't works! Why?