It is currently Mon Dec 11, 2017 7:55 pm


All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Question about QUIT and XINDEX
PostPosted: Wed May 11, 2011 3:01 pm 
User avatar

Joined: Wed Nov 17, 2010 4:02 pm
Posts: 68
Location: Houston TX
Real Name: David Whitten
Began Programming in MUMPS: 06 Jan 1982
XINDEX was run on some code, and gave this message:

. IF %Y=0 QUIT ;"dates are unworkable

LABEL+18 F - Unmatched Quotation Marks.


So, it was saying there is a fatal error that the argument to the QUIT command

consisting of the seven letters: ;"dates

has unmatched quotation marks.

Looking as a MUMPS programmer, I see that the actual problem is that there is only
one space after the QUIT command, or that the semicolon is not a legal "first" character
for an expression which is a quitargument.

What do y'all think ?

Dave


Top
Offline Profile  
 
 Post subject: Re: Question about QUIT and XINDEX
PostPosted: Wed May 11, 2011 6:28 pm 
User avatar

Joined: Fri Nov 05, 2010 11:20 am
Posts: 16
Location: Portland, Oregon
Real Name: Martin Mendelson
Began Programming in MUMPS: 15 Feb 1983
I think that the semicolon starts a comment. Period.

If this line was expected to quit with a return value, then the error ought to stipulate that the return value is missing, not some nonsense about quotation marks.


Top
Offline Profile  
 
 Post subject: Re: Question about QUIT and XINDEX
PostPosted: Fri May 13, 2011 9:35 am 
User avatar

Joined: Wed Nov 17, 2010 4:02 pm
Posts: 68
Location: Houston TX
Real Name: David Whitten
Began Programming in MUMPS: 06 Jan 1982
Marty, you said :
> If this line was expected to quit with a return value, then the error ought to stipulate that the return value is missing, not some nonsense about quotation marks.

My point about this code is that it wasn't written by someone who was coding to expect that the QUIT had a return value, but since the original coder (inadvertently) only used one space after the QUIT, the XINDEX code analyzer took the first set of letters after the QUIT, which happened to start with a comment, and complained about the missing closing quote in that group of letters.

I haven't checked this code out on all MUMPS implementations, but the ones I have easy access to, do indeed treat this semicolon bit as a comment, and indirectly convert the QUIT from being an argumented QUIT into an argument-less QUIT. But I think they are actually violating the MUMPS standard to do so. Which I consider as a flaw in the standard, which is why I posted this idea on MUMPSter.org and want y'all's opinions.

Dave


Top
Offline Profile  
 
 Post subject: Re: Question about QUIT and XINDEX
PostPosted: Fri May 13, 2011 2:43 pm 
User avatar

Joined: Fri Nov 05, 2010 11:20 am
Posts: 16
Location: Portland, Oregon
Real Name: Martin Mendelson
Began Programming in MUMPS: 15 Feb 1983
David,

Quoting from the standard MUMPS Pocket Guide, Fifth Edition:

Commands are separated by one or more spaces, but may have additional spaces between them.......Spacing between the final command and the comment, when one occurs, is the same as between commands.

Seems to me that one space before the semicolon meets the standard and should be treated as a comment. I don't know XINDEX, but it appears that it needs to be corrected.

Cheers.

Marty


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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