Tuesday 13 November 2007

MUMPS language sample

Just discovered this piece of code:
QUE(RTN,DESC,START,ASK) ;
; Queues a job to Taskman with optional user interaction
; Inputs
; RTN : The full routine info to queue
; DESC : The Description for the task
; START : The start date/time (in FM format) for this job
; : If null, uses today's date/time
; ASK : Prompt the user to queue the job?
; : ASK = 0 (don't) or 1 (ask) If null, defaults to 1
; Outputs
; 0 if not tasked, or the Taskman task # if tasked
;
N %,QUE,TIME,I,X,Y,DTOUT,STOP,%DT
N ZTSK,ZTRTN,ZTDESC,ZTIO,ZTDTH
S QUE=0
S RTN=$G(RTN)
S DESC=$G(DESC)
I RTN=""!(DESC="") Q 0
S START=$G(START)
S ASK=$G(ASK)
I ASK="" S ASK=1
I 'ASK S %=1
S STOP=0
I START="" D ;
...
(see this link for the full code)

I was going to add some sarcastic comments but found myself at loss of words..

3 comments:

Anonymous said...

I was just trying to use Silverlight 4 with M -- the Silverlight side is as cryptic and convoluted as ever. More powerful tools can tame this complexity. Gee you don't have that in MUMPS... So which is better -- I guess it is decided by how you get paid -- by the hour or the job!

Nate C-K said...

This is actually an example of good coding style in MUMPS.

ulu said...

Really? Then where is all this ProxyFactoryFactory stuff?