Thanks.

While I got you all on the line, here is another syntax question:

goto Q^DIS2:'$data(DIARU),^DIS2

I initially thought this was the same as:

if '$data(DIARU),^DIS2 goto Q^DIS2

but I realize now it is actually:

if '$data(DIARU) goto Q^DIS2
goto Q^DIS2

(Although these differ in that $T is set by the IF that is not altered by the post-conditional)

But my question is in this line:
  goto Q^DIS2:'$data(DIARU),^DIS2
how the comma (",") is known to mean a second parameter for the GOTO command, and not a second element of the logic for the post-conditional, as in
  if A,B write "hello"

Thanks
Kevin



On 12/31/05, Chris Richardson <[EMAIL PROTECTED]> wrote:
Bright lad.  Happy New Year...
----- Original Message -----
Sent: Saturday, December 31, 2005 5:16 PM
Subject: Re: [Hardhats-members] M syntax question



On 12/31/05, Chris Richardson <[EMAIL PROTECTED]> wrote:
Nope.  Real nice try though.  It might be better done as;
 
S (J(N),DK)=+@("$P("_R_"0),U,2)"),R=$P(^(0),U)
 
  While this looks like the parens are not even, please remember that the R is probably of the form, "^DPT(DA,".  It is also a sneaky way of changing the focus of the naked reference ^(0).  In the example I just drew, we would be looking at the first piece of ^DPT(DA,0) and not ^DPT(0) as some might expect.  The circuitous reference through R is to allow greater flexibility to be pointing to nearly any other entity or sub-entity in the same way.

How does it change the naked reference?  I guess my question is what triggers a change in the naked reference?  If R contained ^DPT(DA, and R is used to concatonate a string, is this enought to change the naked reference?  I think it is only changed with a a global read or write.  So let me think outloud: R_"0)..." becomes ^DPT(DA,0).  This is then used in $P.  Ah-ha. 

Got it.

Kevin




Reply via email to