Copying a voclib paragraph to client

12 views
Skip to first unread message

Dawn Wolthuis

unread,
Mar 28, 2012, 10:29:55 AM3/28/12
to intersystems-mv
Scenario: In a namespace on the server is VOCLIB MY.PARAGRAPH
I want this paragraph in the USER namespace of a client install of Cache'

I know I can do this with accuterm, but I typically use Studio, SMP, and the colon prompt for everything and only need to get accuterm working when I get stuck with this toolset. What would be a suggested way with InterSystems tools (and filezilla, if needed) to accomplish this or should I just use accuterm?

Thanks.  --dawn

--
Dawn M. Wolthuis

Take and give some delight today

Dave Runion

unread,
Mar 28, 2012, 10:41:44 AM3/28/12
to intersy...@googlegroups.com
In Studio you can open individual records by going to file->open and opening, for example, VOCLIB~MY.PARAGRAPH.mvb so you could open it that way on both systems and then copy/paste.

When it comes to transferring files or selected groups of records, I use accuterm.
--
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

Dawn Wolthuis

unread,
Mar 28, 2012, 10:49:58 AM3/28/12
to intersy...@googlegroups.com
Son of a gun, that worked! Thanks Dave. How did you find that out? Anyone know where this tilde syntax is documented so I can pass this info along?  Thanks a bunch (and too bad that it highlights everything as bad syntax -- I wish I could turn off that syntax highlighting in cases like this).  --dawn

Ed Clark

unread,
Mar 28, 2012, 10:52:51 AM3/28/12
to intersy...@googlegroups.com
What Dave said :)
You have several options. If it's a one-time thing, open in studio on one instance and copy-and-paste into studio on the other instance. you can use the filename~itemid.mvb name, or you can put a B on line 6 of the VOC entry for VOCLIB, and then VOCLIB will appear in the studio file open dialog.

you could also open it in studio, then use the context menu "export" option to write the item to an xml file which you could import on the target machine using the tools|import local (or remote) menu option.

You could also export it to xml from studio, and import it from a command line on the remote system with the $SYSTEM.OBJ->Load() method. Instead of studio you could use the $SYSTEM.OBJ->Export() method to write it to xml.

You could also use the %Library.Global->Import() and Export() methods. The advantage there is that you can export/import multiple items (global nodes) at one time, and import nodes selectively.

To move the xml file from one system to another, you could use the %Net.FTP class. Or you could go all out and write a web service to transfer the globals from one system to the other :)

Ed Clark

unread,
Mar 28, 2012, 11:09:21 AM3/28/12
to intersy...@googlegroups.com
I don't know if it is documented anywhere. The tabs in studio used to display the document name using the tilde format, but that display has been shortened in recent releases.
Studio also uses a pipe character to identify alternate data sections. For example if you have a file CUSTOMER with an alternate data section HISTORY you would use the ED command to view an item:
ED CUSTOMER,HISTORY custno
and you could open that item in studio with CUSTOMER|HISTORY~custno

The Tilde form is also useful for opening mv programs in studio from a windows command line, for example:
c:\intersystems\ejc\bin\CSTUDIO.EXE /FASTCONNECT=localhost[1972]:USER /namespace=USER /files=AR-BP~AGING.mvb
would start studio, connect to localhost on port 1972 in namespace USER and open item AGING in file AR-BP

Dave

unread,
Mar 28, 2012, 11:10:28 AM3/28/12
to intersy...@googlegroups.com
I don't remember where it came from, but I'm sure I know it because of Lee Burstein from back when we worked with him regularly.  It's great for editing MV programs that are not in classes (something we have a lot of from our legacy software), and the syntax checking is using MV Basic syntax, so it works really well for that. Since I don't like searching through lists, I skip the "B" in the voc entry and open everything with the tilde syntax.

Dawn Wolthuis

unread,
Mar 28, 2012, 11:12:36 AM3/28/12
to intersy...@googlegroups.com
Very cool. I put a B in the voc entry for voclib and now the directory is in the list and we can bring up a PA and can use studio to edit it. Who knew? (OK, OK, I  know the answer to that might be "everyone except for you, Dawn").  Thanks a bunch!  --dawn

Dawn Wolthuis

unread,
Mar 28, 2012, 11:18:56 AM3/28/12
to intersy...@googlegroups.com
Gotta~love/delimiters&and^special+chars%what|joy,so-much\better$for@machines<than:spaces

Coding up the directory entry so it can be seen from Studio as a folder is a happier solution for me than that tilde, although that was also good to know. Thanks!

Signed, a human being, gender: female

Ed Clark

unread,
Mar 28, 2012, 11:29:59 AM3/28/12
to intersy...@googlegroups.com
I thought the B on line 6 was documented under CREATE-FILE but it doesn't appear to be.
You can put the B there when you create the file by using the format:
CREATE-FILE myfilename (B)
Without the B, files aren't visible in the studio open dialog. this was on purpose. Studio isn't designed to edit data, so it was decided that only program files, identified by the B, would appear.

fyi, there is also an X option on create-file. It is only useful for directory-type files. When you write an item MYPROG to a file marked with X, Cache actually writes out a file named MYPROG.mvb. So you use MYPROG inside of cache, but you have the .mvb extension in the os file which you can use with external editors like ultiedit to identify the file for mv syntax coloring, or file type identification.

Bill Farrell

unread,
Mar 29, 2012, 8:27:50 AM3/29/12
to intersy...@googlegroups.com
Doesn't CREATE.BFILE do the same when you create a DIR type file?

I wasn't aware of the X option. Good to know!

B

Ed Clark

unread,
Mar 29, 2012, 8:51:50 AM3/29/12
to intersy...@googlegroups.com
no, CREATE-BFILE is currently the same as CREATE.FILE and just there for compatability. On legacy systems that support CREATE-BFILE, the command creates the type of file required for basic programs: either a pointer-type file or a directory-type file. Cache doesn't require a particular type of file for programs so doesn't do anything unique with CREATE.BFILE.

Bill Farrell

unread,
Mar 29, 2012, 11:24:37 AM3/29/12
to intersy...@googlegroups.com
Okiedoke. It does add the B for you, so I suppose that saves an EDIT VOC
thingie. I use CREATE.BFILE to parcel-off routines as I'm building Weather
and Farm. I've noticed in 2012.1 the Studio doesn't care for opening up
files and saving them in files that aren't BP. Up until now, I've worked in
different libraries (BPs, that is) with impunity. If you add a routine to a
project that isn't in BP (that is, living in some other Bfile), save, close,
and reopen the project, then try to open that routine again, Studio will
claim the file doesn't exist (though you can clearly see it from TCL LIST
mybfile).

I'll try the X option this weekend and see if that helps. From the
description that might be the ticket.

Ed Clark

unread,
Mar 29, 2012, 11:52:30 AM3/29/12
to intersy...@googlegroups.com
I don't think the (X) option will help with what you describe. All it does is change the name that the file is stored in an os directory as. Studio always adds the .mvb extension to define the document type. X just controls whether to not a .mvb is added and stripped when the item is read/written.

Bill Farrell

unread,
Mar 29, 2012, 12:48:26 PM3/29/12
to intersy...@googlegroups.com
It was worth a shot to think it out loud :)

Thanks, Ed.

Reply all
Reply to author
Forward
0 new messages