It is currently Thu Mar 28, 2024 4:50 am


All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Unit 1 - Lesson 3: The Partition
PostPosted: Thu May 19, 2011 6:33 am 
User avatar

Joined: Wed Nov 17, 2010 8:37 am
Posts: 136
Real Name: Terry L. Wiechmann
Began Programming in MUMPS: 0- 0-1971
The concept of a partition goes back to the beginning of MUMPS. It's important to understand that the partition is a logical concept and is not a part of the standard. For this course it is meant as a teaching device. It is not given any attention in the standard and is only mentioned in the definitions section of the 1995 language specification. So, look at the partition as a logical concept for teaching, not a physical concept for implementation.

Please note: Under the Associated Routine section, reference is made to non-standard commands ZRemove, ZLoad, ZSave. Command, Function, Special Variable and Structured System Variable names that begin with Z are nonstandard. These commands originated in DEC's MUMPS-11 and were perpetuated through DSM-11 and it's derivatives and clones VAX DSM, MSM and all of InterSystems implementations. GT.M and MUMPSV1 do not use them.

Generally study this section and understand the contents of the partition.

_________________
Terry L. Wiechmann


Top
Offline Profile  
 
 Post subject: Re: Unit 1 - Lesson 3: The Partition
PostPosted: Wed Jun 01, 2011 5:29 pm 

Joined: Tue May 24, 2011 8:27 am
Posts: 2
Location: Vista CA
Real Name: Patrick McCann
Began Programming in MUMPS: 24 May 2011
Hi Terry,
I hope this is the place to ask questions. I am curious about the "Associated Routine". Is this a routine that is executed when you login to a namespace? If so, how is it "triggered" or is my understanding of this routine not correct?
Thank you,
Patrick


Top
Offline Profile  
 
 Post subject: Re: Unit 1 - Lesson 3: The Partition
PostPosted: Thu Jun 02, 2011 10:06 am 
User avatar

Joined: Wed Nov 17, 2010 8:37 am
Posts: 136
Real Name: Terry L. Wiechmann
Began Programming in MUMPS: 0- 0-1971
Thank you for the question. It points out the fact that this section in the guide should be rewritten.

A little bit of history. The original MUMPS systems did not run on general purpose operating systems as they do now. They took over a machine and had there own OS built in. Everything was self contained.

The information given in the Associated Routines section is basically a relic of that era. It applies to all derivative systems of DSM-11 (physically or cloned) but not GT.M or MUMPSV1. The associated routine concept came from the fact that a partition had a routine buffer associated with it where the routine was loaded and executed. Routines were generally stored under the Global Module(the database). They could be loaded, edited and deleted using these Z commands within this buffer. It was the workplace for the programmer.

Since it was incredibly expensive to dedicate a machine to MUMPS only, MUMPS implementations migrated to general purpose OS's where other applications could be run. This gave the implementers choices as to how they wanted to handle creating, editing and executing a routine(s). Some stuck with the Z command approach. GT.M moved the routines to the file system to take advantage of the available editing tools, etc.

The bottom line is that routines are associated with a process through the execution process. Here's the explanation that applies to all MUMPS systems. What happens under the hood is irrelevant.

For any MUMPS process, you can execute a MUMPS program. The program consists of one or more MUMPS routines that call each other according to how the programmer designed them. Every program has as (at least) one entry point where execution starts. There are two modes in which execution can begin. First, when you are in programming mode, that is, when working at the ">" prompt. Second, in application mode where the program is executed from the actual MUMPS command line typically from a script.

Lets take the programming mode approach. To execute the routine, you would enter enter one of two commands:

> DO entryref
or
> GOTO entryref

without getting into the standard definitional formality of it, an entryref can be:

label [ +integer] [ ^routinename ]
or simply
^routinename

That is:

DO ^PATENT
where PATENT is the entry point routine. Execution will begin with the first line.
or
DO ENTER^PATENT
where execution will begin at the line with the label ENTER.
or
DO ENTER+3^PATENT where execution will begin 3 lines beyond ENTER. This not recommended!
or
DO ENTER where it is assumed that the execution context is within the routine ^PATENT.

Before executing a routine, there is no routine associated with the process (or partition).When executed, the routine(s) are associated with the process. How this happens is implementation specific.

When executed in application mode, the entry point is specified on the MUMPS command line. An implicit DO is performed.

I hope this did not confuse you further. This seems like a perfect place for certain implementers to jump in.

_________________
Terry L. Wiechmann


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 10 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net