^ROUTINE(,"MAP") ?

161 views
Skip to first unread message

Michae...@kp.org

unread,
Nov 14, 2013, 9:25:45 AM11/14/13
to intersystems...@googlegroups.com
Anyone know what this subscript level is for in ^ROUTINE?  I've tried searching documentation but I guess the "^" is stripped out so I get hundreds of hits.  I did see one reference to intermediate code that is stored in ^ROUTINE, so maybe that?  What I've noticed is that some of our routines have this level but most don't.  It also looks like if I ZL/ZS a routine its "MAP" entry goes away.

Just curious.  We're on 2008.2, if it matters.

-Michael

Claud Marques

unread,
Nov 14, 2013, 9:48:28 AM11/14/13
to intersystems...@googlegroups.com

Read mapping routines and globals.

--
--
Caché, Ensemble, DeepSee
 
---
You received this message because you are subscribed to the Google Groups "Caché, Ensemble, DeepSee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to intersystems-publi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Michae...@kp.org

unread,
Nov 14, 2013, 9:52:00 AM11/14/13
to intersystems...@googlegroups.com
Not sure what section that is, but if it talks about namespace mapping of routines & globals, I don't think this is related.  The routines I'm looking at aren't mapped to any other namespace.

> Sent by: intersystems...@googlegroups.com

Tom Fitzgibbon

unread,
Nov 14, 2013, 10:08:49 AM11/14/13
to intersystems...@googlegroups.com
Michael - Not quite sure what you are asking about.  You probably already know this but INT routines have:

1) ^ROUTINE(ROUTINE NAME,0) = $h last edit
2) ^ROUTINE(ROUTINE NAME,0,0) = number of lines
3) ^ROUTINE(ROUTINE NAME,0,0,1...) = routine lines

My old InterSystems Code notes (Cache 2008) - See 2,3 below: 

1)      Most important: InterSystems suggests using Cache Studio editing and compile rather than %RCOMPIL, or ZS or .F.

2)      Studio compile (by default) saves last 5 versions of .INT routines in ^rBACKUP(“routine name”

3)      Studio compile (by default) saves last 5 versions of .MAC routines in ^rMACSAVE(“routine name”

4)      Studio error checking decreases error introduced by programmers

5)      Studio editing is faster than ^% or ^%E

 Cache File Types

.MAC – Macro Source code (can include .INC fragments, SQL, other macro features) and compiles down to…

.INT – Intermediate code (old fashioned routine) and compiles down to…

.OBJ – Object (sort of executable but no easy programmer access

 

.INC – include (pops in common code into a .MAC)

.BAS – IS Basic

 

No auditing or historical routine copies are offered by Cache from ZS or .F file routine.  IS indicates programmers should use  a third party version control tool.


Tom Fitzgibbon | Multidata | 212-967-6700 x537



--

Michae...@kp.org

unread,
Nov 14, 2013, 10:22:53 AM11/14/13
to intersystems...@googlegroups.com
Hmmm.  Perhaps undocumented then.  Here's an example.  Whatever is in here, it's mostly not in the printable ASCII spectrum.  (This is an .INT routine.)

^ROUTINE("ABCDE","MAP",0)=$c(1,0,1,2)_"*7]Mø"_$c(5)
                       1)="Ì"_$c(0,0,0,1,0)_"*"_$c(0,0,0,2,0)_"C"_$c(0,0,0,3,0)_
"6"_$c(0,0,0,4,0)_"0"_$c(0,0,0,5,0,2,0,0,0,6,0,1,0,3,0,7,0,2,0,3,0,8,0,14,0,3,0,
9,0)_"V"_$c(0,3,0,10,0,27,0,3,0,11,0,28,0,3,0,12,0)_" "_$c(0,3,0,13,0)_"!"_$c(0,
3,0,14,0,28,0,3,0,15,0)_"#"_$c(0,3,0,16,0,2,0,3,0,17,0,3,0,13,0,18,0,1,0,18,0,19
,0,1,0,26,0,20,0,1,0,30,0,20,0,12)_"@"""_$c(0,20,0,27,128)_"$"_$c(0,20,0)_" "_$c
(128)_"&"_$c(0,21,0,1,0)_"("_$c(0,21,0,12)_"@*"_$c(0,21,0,24)_"@9"_$c(0,22,0,1,0
)_"<"_$c(0,23,0,2,0)_"<"_$c(0,24,0)_"#"_$c(0)_"<"_$c(0,25,0,1,0)_"G"_$c(0,26,0,1
,0)_"Y"_$c(0,27,0,1,0)_"d"_$c(0,28,0,1,0)_"r"_$c(0,29,0,1,0)_"}"_$c(0,30,0,2,0)_
"}"_$c(0,31,0,1,0,136,0)_" "_$c(0,1,0,151,0)_"!"_$c(0,1,0,159,0)_""""_$c(0,1,0)_
"¢"_$c(0)_"#"_$c(0,2,0)_"¢"_$c(0)_"$"_$c(0,1,0)_" "_$c(0)_"$"_$c(0,15,128)_"ª"_$
c(0)_"$"_$c(0,27)_"@ "_$c(0)_"$"_$c(0)_"O@°"_$c(0)_"%"_$c(0,1,0)_" "_$c(0)_"%"_$
c(0,16,128)_"½"_$c(0)_"%"_$c(0)_"%@À"_$c(0)_"%"_$c(0)_"J@Ã"_$c(0)_"&"_$c(0,1,0)_
"Ç"_$c(0)_"&"_$c(0,12,128)_"Ë"_$c(0)_"&"_$c(0,25,128)_"Ö"_$c(0)_"&"_$c(0)_"6@ú"_
$c(0)_"&"_$c(0)_"}@ÿ"_$c(0)_"'"_$c(0,1,0,1,1)_"'"_$c(0,12,128,5,1)_"'"_$c(0,25,1
etc.

In fact ^ROUTINE (well, at least the routine I'm looking at) has these levels:

^ROUTINE("ABCDE",0)
^ROUTINE("ABCDE",0,0)
^ROUTINE("ABCDE",0,line_counter)
^ROUTINE("ABCDE",0,"SIZE")
^ROUTINE("ABCDE","LANG")
^ROUTINE("ABCDE","MAP",0)
^ROUTINE("ABCDE","MAP",1)


> Subject: Re: [Caché] ^ROUTINE(,"MAP") ?
> Sent by: intersystems...@googlegroups.com

Tom Fitzgibbon

unread,
Nov 14, 2013, 10:32:58 AM11/14/13
to intersystems...@googlegroups.com
LANG and SIZE are created after a Studio edit.  What are you using to edit COS routines?


--

Tom Fitzgibbon

unread,
Nov 14, 2013, 10:45:47 AM11/14/13
to intersystems...@googlegroups.com
If you look at %R (routine APIs) in %SYS namespace, "MAP" is referenced several times but check with IS support.  "MAP" also get killed when you simply .F from ^% editor, so it's not too persistent.

Vik Nagjee

unread,
Nov 14, 2013, 10:46:16 AM11/14/13
to intersystems...@googlegroups.com
That’s an internal node that’s generated by the kernel when needed by the debugger in order to report the precise location of an error or a break in the code.

Tom Fitzgibbon

unread,
Nov 14, 2013, 10:52:41 AM11/14/13
to intersystems...@googlegroups.com
Vik wins this one.  Insert a Break into your COS INT routine and see "MAP" reappear.

Michae...@kp.org

unread,
Nov 14, 2013, 11:25:53 AM11/14/13
to intersystems...@googlegroups.com
Interesting!  Thanks, Vik & Tom.  Sure enough, hitting a breakpoint in a routine creates that level.  (Btw, Tom, we use Studio to edit...)

> From: Tom Fitzgibbon <t...@mul.com>
> To: intersystems...@googlegroups.com
> Date: 11/14/2013 10:53 AM
> Subject: Re: [Caché] ^ROUTINE(,"MAP") ?
> Sent by: intersystems...@googlegroups.com
>

>
Reply all
Reply to author
Forward
0 new messages