Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
freem freem
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 20
    • Issues 20
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • John P. Willis
  • freemfreem
  • Wiki
  • User Defined Z Functions

Last edited by John P. Willis Mar 02, 2020
Page history

User Defined Z Functions

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.

Clone repository
  • Build Instructions
  • Coding Standards
  • Conditions for Public Release
  • FreeM Commands
  • FreeM Intrinsic Functions
  • FreeM Intrinsic Special Variables
  • FreeM Invocation
  • Implementation Limits
  • Namespace Management
  • The FreeM REPL
  • User Defined Z Functions
  • VIEW Commands and Functions
  • [Historic] C2M Specification
  • [Historic] Change Log
  • [Historic] Compiling with LCC on Windows NT
View All Pages