Global name from class

2 views
Skip to first unread message

James Westley Farrell

unread,
Dec 19, 2014, 2:38:42 PM12/19/14
to intersystems-mv
I've missed this somewhere and I'm not finding it in the doc. When I create a persistent class that extends %MV.Adaptor and set the MVCREATE and MVREPOPULATE parameters to 1 it works really, really nicely except for one thing. When I do
:CT VOC myfile

attributes 2 and 3 reference globals that start with "D.". It's handy that the class created and associated a global for me, but can I control the global name? Like, it would be nice if my USER MV file, the User.cls, and the global name somewhat matched. I don't see a property for this in %MV.Adaptor.

Thanks,
Bill


"He is your friend, your partner, your defender, your dog. You are his life, his love, his leader. He will be yours, faithful and true, to the last beat of his heart. You owe it to him to be worthy of such devotion" -- Unknown

Josh Barney

unread,
Dec 19, 2014, 2:47:07 PM12/19/14
to intersystems-mv

Parameter MVGLOBAL As %String = "^CPT.AUTH";

--
You received this message because you are subscribed to the Google Groups "InterSystems: MV Community" group.
---
You received this message because you are subscribed to the Google Groups "InterSystems: MV Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to InterSystems-...@googlegroups.com.
To post to this group, send email to InterSy...@googlegroups.com.
Visit this group at http://groups.google.com/group/InterSystems-MV.
For more options, visit https://groups.google.com/d/optout.

James Westley Farrell

unread,
Dec 19, 2014, 2:54:20 PM12/19/14
to intersystems-mv
The class compile doesn't complain but it still creates ^D.something globals for the DICT and DATA. I think we're onto something but not there yet.

I did completely delete the file in question before I recompiled.

Thanks,
B

"He is your friend, your partner, your defender, your dog. You are his life, his love, his leader. He will be yours, faithful and true, to the last beat of his heart. You owe it to him to be worthy of such devotion" -- Unknown

Josh Barney

unread,
Dec 19, 2014, 2:58:14 PM12/19/14
to InterSy...@googlegroups.com

Here are the different options that we typically use, as a note we are using an older version still so some of this may have been updated in recent years.

 

Parameter MVCLEARDICT = 0;

Parameter MVCREATE As BOOLEAN = 1;

Parameter MVFILENAME As STRING = "CPT.AUTH";



Parameter MVGLOBAL As %String = "^CPT.AUTH";

Parameter MVREPOPULATE = 0;

John Lambert

unread,
Dec 19, 2014, 2:59:37 PM12/19/14
to <InterSystems-MV@googlegroups.com>
I think you need to edit the class and delete the storage section at the end


Sent from my iPhone

Edward Clark

unread,
Dec 19, 2014, 3:05:11 PM12/19/14
to InterSy...@googlegroups.com

The MVGLOBAL parameter was removed around 2008 I think.

It you define an MVFILENAME parameter, it will try to use that name for the global as well. Otherwise it uses the name of the class for both the global and the filename.

If MVFILENAME isn’t a valid global name (for instance if it has a dash in it) then a generated name beginning with D will be used.

A generated name will also be used if the global already exists when you compile the class, or if the global name is already associated with a different class.

If you change the MVFILENAME, you also have to delete (or edit) the class’s <STORAGE> definition.

 

Btw, MVCREATE and MVREPOPULATE default to 1, so don’t need to be defined if you want the class to create and update the file.

James Westley Farrell

unread,
Dec 19, 2014, 3:11:51 PM12/19/14
to intersystems-mv
That was it... deleting the storage did it. Thanks!

It's always the little brainfarts ahead of a deployment. Man, I need sleep!

"He is your friend, your partner, your defender, your dog. You are his life, his love, his leader. He will be yours, faithful and true, to the last beat of his heart. You owe it to him to be worthy of such devotion" -- Unknown

Reply all
Reply to author
Forward
0 new messages