Mumpster http://www.mumpster.org/ |
|
Question about QUIT and XINDEX http://www.mumpster.org/viewtopic.php?f=14&t=673 |
Page 1 of 1 |
Author: | whitten [ Wed May 11, 2011 3:01 pm ] |
Post subject: | Question about QUIT and XINDEX |
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 |
Author: | mmendelson7 [ Wed May 11, 2011 6:28 pm ] |
Post subject: | Re: Question about QUIT and XINDEX |
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. |
Author: | whitten [ Fri May 13, 2011 9:35 am ] |
Post subject: | Re: Question about QUIT and XINDEX |
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 |
Author: | mmendelson7 [ Fri May 13, 2011 2:43 pm ] |
Post subject: | Re: Question about QUIT and XINDEX |
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 |
Page 1 of 1 | All times are UTC - 8 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |