How do I get the currently-running MLM name without the user name at the beginning? The special keyword THIS_MLM_NAME
returns the name of the MLM in the format USERNAME-302364198::MLM_NAME_HERE
, but I just want the MLM's name by itself.
I tried using SUBSTRING
:
SUBSTRING 200 CHARACTERS
STARTING AT ((FIND "::" IN THIS_MLM_NAME) + 2)
FROM THIS_MLM_NAME;
But this just returns null
. What am I doing wrong?
The problem is that
THIS_MLM_NAME
is not actually an Arden string. If you testTHIS_MLM_NAME IS STRING
you will get false. To fix that, convert it to a string withTHIS_MLM_NAME AS STRING
:Since there is no debugger in Sunrise Acute Care's implementation of Arden, I wrote the following MLM to help show information about variables (name the module
MOD_VARIABLE_INFO
or change the code to match the actual name):While this MLM returns "Unknown" for
THIS_MLM_NAME
, it at least shows that it is not any of the native Arden data types nor is it a .Net data type.In the Sunrise MLM Editor, you can see what is going on in the underlying Lisp by syntax checking the MLM, then clicking on the "Syntax Check MLM" tab, selecting "Function Definition" then looking at the code in the lower right pane. Search for
THIS_MLM_NAME
and you will find(SETQ THIS_MLM_NAME 'USERNAME-302364198::MLM_NAME)
. From this you can see that the variable has been set to a plain quoted/unevaluated lisp expression rather than a string, which would look like(SETQ THIS_MLM_NAME "USERNAME-302364198::MLM_NAME")
.