The QUIT command on the SAME LINE as the FOR command controls
quitting the most previous FOR loop, 
and has no impact on the subroutine stack.

A GOTO command on the SAME LINE as the FOR command will leave all FOR
loops on that line previoius to the GOTO command.

The QUIT command is a context sensitive command in MUMPS.
There are very few context sensitive aspects in MUMPS.
The only other one I can think of is the $TEST variable being
saved prior to a (Argumentless) DO (dot) code line.

You could consider MUMPS data interpretation to be a context sensitive
where a variable's value is dependent upon the operations being done
using it: for example X>3 uses the numeric interpretation of the value
of the variable X, and X=3 uses the string interpretation of the value
of the variable X and 'X uses the boolean interpretation. One could argue
that @X forces an interpretation which is very context sensitive based
on the command or function that the @X is used within.

Best Regards,
David Whitten

> 
> Hey all,
> 
> I am working with this line of code:
> 
> F D0=0:0 S D0=$O(^UTILITY(U,$J,DDF(1),D0)) S:D0=""
> D0=-1 Q:'$D(^(D0,0))  S Z=^(0) D I^DITR
> 
> 
> My question, does the QUIT in this line quit the For
> loop, or quit the function?
> 
> Would this be equivalent code:
> 
> F D0=0:0 DO  GOTO:'$D(^(D0,0)) LABEL1
> . S D0=$O(^UTILITY(U,$J,DDF(1),D0)) 
> . S:D0="" D0=-1 
> . Q:'$D(^(D0,0))  
> . S Z=^(0) 
> . D I^DITR
> 
> LABEL1
>  QUIT
> 
> 
> Thanks
> Kevin
> 
> 
>               
> __________________________________ 
> Do you Yahoo!? 
> Check out the new Yahoo! Front Page. 
> www.yahoo.com 
>  
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Sybase ASE Linux Express Edition - download now for FREE
> LinuxWorld Reader's Choice Award Winner for best database on Linux.
> http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
> _______________________________________________
> Hardhats-members mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/hardhats-members
> 



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Hardhats-members mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to