I have a piece of mumps code
DO ENYA^PRCTQUES
and
DO ^PRCTQUES
I understand what the first one does. However, I don't know what the 2nd example does. What's it calling?
EDIT - What if the code at the top is all comments?
PRCTQUES ; comment
;;comment
; MOAR comment
;
So what are we doing here with DO ^PRCTQUES ? Just making sure the file exists and is compiled?
Finally what if my file started with the label ZOOT?
ZOOT
(code)
Q
then what? Does DO ^PRCTQUES invoke the ZOOT label because it is at the top? Or do I get an error message? It looks like bad style of course...
If you have a routine FOO that looks like this:
DO ^FOOwill show the output "HELLO FOO".DO LABEL^FOOwill show "HELLO LABEL".So calling a routine without a label (as in
DO ^PRCTQUES) will execute the routine from the top. Otherwise, with a labelDO ENYA^PRCTQUESit will run the code starting from the label.In your edited question, you asked about what happens if you have a routine
PRCTQUESwith a labelZOOTat the top. Like this:In this case,
DO ^PRCTQUESwill writeZOOT. Also,DO ZOOT^PRCTQUESwill also writeZOOT. However, because most companies consider it a bad practice that the first label in the routine isn't the routine name, so this is not an example you see in practice.