It is currently Mon Mar 18, 2024 9:20 pm


All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: $ZN in MumpsV1 ?
PostPosted: Sun Jul 07, 2013 5:20 am 
User avatar

Joined: Sun Mar 27, 2011 8:12 am
Posts: 87
Location: Europe , HUNGARY
Real Name: Josef Nagy
Began Programming in MUMPS: 0- 0-1991
Hi

Some MUMPS implementation use the $ZN formula for actual routine name string .
In MUMPSV1 actual routine name string is = $G(^$J($J,"ROUTINE_NAME"))

BUT , if use in routine EXECUTE and in the executed commands string including this $G(^$J($J,"ROUTINE_NAME")) , return a empty string !!

My alternate solution , the STACK trace , something like :

Code:
%ZN()   ;Return Main routine name from STACK [ 07/07/2013 14:09 PM ]
        N 
        S %mref="",%st=0 F  Q:$F(%mref,"^")!(%st>99)  S %st=%st+1,%mref=^$J($J,"$STACK",^$J($J,"$STACK")-%st,"PLACE")
        Q $P(%mref,"^",2)


Usage : W $$^%ZN

Another idea ??

_________________
Josef Nagy
[MUMPS based industrial application in Processing Controll (MCU/PLC/MUX)]


Top
Offline Profile  
 
 Post subject: Re: $ZN in MumpsV1 ?
PostPosted: Mon Jul 08, 2013 3:43 am 
User avatar

Joined: Wed Jul 20, 2011 11:49 am
Posts: 9
Location: Russia, Moscow
Real Name: Eugene Karataev
Began Programming in MUMPS: 10 Mar 1997
Try to use function $TEXT inside routine context
$t(+0) is a special case of the $text argument to return current routine executed.


Top
Offline Profile  
 
 Post subject: Re: $ZN in MumpsV1 ?
PostPosted: Mon Jul 08, 2013 1:36 pm 
User avatar

Joined: Sun Mar 27, 2011 8:12 am
Posts: 87
Location: Europe , HUNGARY
Real Name: Josef Nagy
Began Programming in MUMPS: 0- 0-1991
This $t(+0) working inside routine , but in EXECUTE return empty string

Code:
;Test EXECUTED $ZN in MumpsV1
     W !,"ROUTINE="_$T(+0)
     S XS="ROUTINE=",XX="W !,XS_$T(+0)"
     X XX
     Q



[TMP]MCL> D ^BB

ROUTINE=BB
ROUTINE=
[TMP]MCL>

_________________
Josef Nagy
[MUMPS based industrial application in Processing Controll (MCU/PLC/MUX)]


Top
Offline Profile  
 
 Post subject: Re: $ZN in MumpsV1 ?
PostPosted: Thu Nov 21, 2019 2:00 am 

Joined: Thu Nov 21, 2019 1:58 am
Posts: 1
Real Name: sahil
Began Programming in MUMPS: 10 Aug 1995
Great Information.Thank You :)

_________________
Clinical Data Management Course


Top
Offline Profile  
 
 Post subject: Re: $ZN in MumpsV1 ?
PostPosted: Mon Nov 25, 2019 11:49 pm 

Joined: Mon Nov 25, 2019 11:47 pm
Posts: 1
Real Name: sanavi
Began Programming in MUMPS: 02 Apr 2006
Great Post :)

_________________
Android courses in Mumbai


Top
Offline Profile  
 
 Post subject: Re: $ZN in MumpsV1 ?
PostPosted: Wed Aug 12, 2020 9:24 pm 

Joined: Wed Aug 12, 2020 9:23 pm
Posts: 1
Real Name: Harman singh
Began Programming in MUMPS: 03 May 1992
Try to use function $TEXT inside routine context


Top
Offline Profile  
 
 Post subject: Re: $ZN in MumpsV1 ?
PostPosted: Sat Aug 29, 2020 12:07 am 

Joined: Sat Aug 29, 2020 12:04 am
Posts: 1
Real Name: Aviyo1
Began Programming in MUMPS: 03 Aug 1993
Very useful post Thanks


Top
Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net