Can I specify namespace when opening an object in mvb basic program

3 views
Skip to first unread message

Rich Brim

unread,
Feb 3, 2012, 2:35:00 PM2/3/12
to InterSystems: MV Community
I wrote a routine that I am running in a namespace to process payments
in telnet session. Rather than logging to each namespace and running,
can I somehow specify namespace? I would do this with a q-pointer in
non OOP.


payobj = "MVFILE.PAYMENT"->%OpenId(id)


thanks,
Rich

Rich Taylor

unread,
Feb 3, 2012, 4:21:42 PM2/3/12
to intersy...@googlegroups.com
Rich,

A class will always run in the current context, that being the current namespace. You can, however, programmatically switch namespaces to change the context you are running in. The command to do this is

$XECUTE 'ZNSPACE "new namespace"'

Just be sure to switch back to the namespace you started from when that section of code is complete.

Richard S Taylor
Sales Engineer
InterSystems Corporation
Office: 443-340-8614
FAX: 440-815-5805


thanks,
Rich

--
You received this message because you are subscribed to the Google Groups "InterSystems: MV Community" group.
To post to this group, send email to Cac...@googlegroups.com
To unsubscribe from this group, send email to CacheMV-u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/CacheMV?hl=en

Reply all
Reply to author
Forward
0 new messages