I attached an exported TM ART Monitor Workbench project that ran ok on my system. It is an unsupported example of what you are asking for.
The main routine CallGetMyLoc.bdf includes getmylocation.bdh which contains your function.
FunctionExample.ltz 45.0 K
Thank you so much Dan... I just figure out what I did wrong... I had included the VAR session after the begining... and I was starting the code with the dclfunc line...
Thanks you very much!