FreeM allows you to design and implement your own Z
-commands and $Z
-functions directly in MUMPS code.
In order to implement your own Z
-command, you will need to create a MUMPS routine in the system library namespace (mlib
).
Let's say you want to implement ZFOO
. In order to do this, you'd create the file %ZFOO.m
in mlib
. When called as ZFOO argument
from other FreeM code, this will be executed as the following:
XECUTE "NEW % SET %=argument DO ^%ZFOO"
If you wanted to implement $ZFOO
, the routine you'd create is still %ZFOO.m
, but if called as SET RESULT=$ZFOO(argument)
, would be executed as follows:
SET RESULT=$$^%ZFOO(argument)
Please note that user-defined Z
commands and functions must not collide with existing, predefined Z
commands and functions. You may obtain a list of predefined Z
commands and functions with the following:
USER> WRITE $VIEW(18),!
zb zc zd ze zh zht zk zl zm zn zo zp zr zs zt zboolean zcall zcr zcrc zdata zdate zedit zhorolog zkey zlength zlsd zname znext zorder zpiece zprevious zreplace zsyntax zsort ztime zzip
VIEW 18
can be used to redefine the list of predefined Z
commands and functions.