Here's a tip to make sure you don't fall foul of MUMPS' unusual
if/else construction and its reliance on $t which can inadvertently
cause you problems (another area of weirdness that can cause hours of
debugging grief)
As a matter of course, I structure them as follows:
if condition do
. ; whatever needed for main condition
.; etc....
else do
. ; whatever needed for else condition
. ;etc...
This use of "dot syntax" gives you the syntactical equivalent to the
C-style:
if (condition) {
//whatever you need to do
}
else {
//whatever else you need to do
}
so it's a reasonably familiar construct for someone new to MUMPS, and
also will behave as you'd expect.
Note the 2 spaces between "else" and "do"
On Sun, 4 May 2008 00:39:17 -0700 (PDT), lmv <lverhulst@[EMAIL PROTECTED]
>
wrote:
>On May 3, 10:23 pm, Duke Normandin <dukeofp...@[EMAIL PROTECTED]
> wrote:
>> Given:
>>
>> set i=1,j=2,k=3
>>
>> what does the following say:
>>
>> if i=0!(j=2) write "yes",!
>> ^^^^^^^^^
>> this is confusing me. What is the 'nl' command doing there?
>> --
>> Duke Normandin
>
>The ! symbol is an "or" when used with an IF command or as part of a
>condition. It is a "nl" when used with the write command.
>
>--Leane
---
Rob Tweed
Company: M/Gateway Developments Ltd
Registered in England: No 3220901
Registered Office: 58 Francis Road,Ashford, Kent TN23 7UR
Web-site: http://www.mgateway.com
SlipstreamUSA: April 2, Renaissance Hotel, Orlando
http://www.OutOfTheSlipstream.com


|