腮腺炎语法声明
Q ZR $ZTLP I Q=-1 S Q,A=F G T
I Q< S A=F G R
如何在MUMPS中识别标签、关键字和变量?
上面代码中的 Q 是什么?即标签、变量或关键字?
定义变量关键字和子程序的规则是什么?
否则很难识别,你能建议为什么吗,因为我无法理解我现有的代码是什么?
Q ZR $ZTLP I Q=-1 S Q,A=F G T
I Q< S A=F G R
How to identify Label, Keyword and Variable in MUMPS?
What is Q in above code? i.e. Label, Variable or Key word?
What are the rules to define variable keyword and subroutine?
Otherwise it is difficult to identify could you suggest why because I can't understand my existing code which is what?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Q
在第一个实例中表示QUIT
,但随后IQ=-1
是IF Q EQUALS -1
-Q
在这里也是一个变量 - 不是很好的做法Q
meansQUIT
in first instance but thenI Q=-1
isIF Q EQUALS -1
-Q
is a variable here too - not very good practice秘密是:空格。
一般 MUMPS 程序行语法为:
...
标签和参数是可选的:当一行没有标签时,它以制表符开头,当命令没有参数时(在极少数情况下会发生,例如:退出),命令后面跟着两个空格。
当一行以命令开头(没有标签和制表符)时,它不是程序的一部分,但它是立即执行的命令。
您可能会觉得这很令人困惑,但请记住,MUMPS 是在机器速度缓慢时设计的;如果严格分隔命令,则很容易解析命令。这就是为什么命令可以缩写为单字母,也是为什么 MUMPS 没有操作优先级(较新的 MUMPS 系统可配置为使用操作符优先级而不是传统的从左到右的处理顺序)。
The secret is: whitespaces.
General MUMPS program line syntax is:
...
Lebel and arguments are optional: when a line has no label, it begins with tab, when a command has no arguments (it happens in rare cases, e.g.: Quit), the command is followed by two spaces.
When a line begins with command (no label and no tab), it's not part of a program, but it is an immediatelly executed command.
You may feel that it's confusing, but remember, MUMPS was designed when machines were slow; it's easy to parse commands if they are strictly delimited. That's why commands can be abbreviated as single-letter, and also that's why MUMPS have no operation precedence (newer MUMPS systems are configurable to use operator precedence instead of traditional left-to-right processing order).