Correcting Errors in an M Routine

Now that the routine errors have been identified, correct them in the M source file. Use ZEDIT to invoke the editor and open the file for editing. Correct the errors previously identified and enter <CTRL-Z> to exit the editor.

Example:

        GTM>ZEDIT "dmex"
        dmex;dmex - Direct Mode example
        ;
        begfor read !,"Name: ",name do name q:name="Q"
        quit
        nameset ln=$l(name)
        if ln,$e("QUIT",1,ln)=$tr(name,"quit","QUIT") d q
        . s name="Q"
        if ln<30,name?1.a.1"-".a1","1" "1a.ap do print q
        write !,"Please use last-name, "
        write "first-name middle-initial or 'Q' to Quit."
        quit
        printwrite !,$p(name,", ",2)," ",$p(name,", ")
        quit
        GTM>
        

This example shows the final state of a ZEDIT session of dmex.m. Note that the infinite FOR loop at line beg is corrected.