The problem is that THIS_MLM_NAME is actually not an Arden string. If you check THIS_MLM_NAME IS STRING , you will get false. To fix this, convert it to a string using THIS_MLM_NAME AS STRING :
ThisMLMName := SUBSTRING 200 CHARACTERS STARTING AT ((FIND "::" IN STRING (THIS_MLM_NAME AS String)) + 2) FROM (THIS_MLM_NAME AS String);
Since there is no Arden debugger in Sunrise Acute Care, I wrote the following MLM to help show variable information (name the module MOD_VARIABLE_INFO or change the code to match the actual name):
// data slot (Variable, Padding) := ARGUMENT; Result := ""; IF NOT EXIST Padding THEN Padding := ""; ENDIF; CR := (13 FORMATTED WITH "%c") || Padding; Delimiter := ""; MOD_VARIABLE_INFO := MLM 'MOD_VARIABLE_INFO'; IF Variable IS LIST THEN Result := Result || "List(" || (COUNT Variable) || ") [" || CR || " "; FOR Item IN Variable DO Result := Result || Delimiter; TempResult := CALL MOD_VARIABLE_INFO WITH Item, Padding || " "; Result := Result || TempResult; Delimiter := "," || CR || " "; ENDDO; Result := Result || CR || "]"; ELSEIF Variable IS STRING THEN Result := Result || "String"; ELSEIF Variable IS NUMBER THEN Result := Result || "Number"; ELSEIF Variable IS BOOLEAN THEN Result := Result || "Boolean"; ELSEIF Variable IS NET_OBJECT THEN Result := Result || ".Net Object"; ELSEIF Variable IS NULL THEN Result := Result || "Null"; ELSEIF Variable IS OBJECT THEN Result := Result || "Object {" || CR || " "; FOR Attr IN (EXTRACT ATTRIBUTE NAMES Variable) DO Result := Result || Delimiter || Attr || ": "; Item := ATTRIBUTE Attr FROM Variable; TempResult := CALL MOD_VARIABLE_INFO WITH Item, Padding || " "; Result := Result || TempResult; Delimiter := "," || CR || " "; ENDDO; Result := Result || CR || "}"; ELSE Result := Result || "Unknown (" || Variable || ")"; ENDIF; // logic slot CONCLUDE True; // action slot RETURN Result;
While this MLM returns "Unknown" for THIS_MLM_NAME , it at least shows that it does not belong to Arden's own data types and is not a .Net data type.
In the Sunrise MLM editor, you can see what happens in the underlying Lisp using the syntax that validates MLM, then clicking the MLM Syntax Validation tab, selecting Function Definition, and then viewing the code in the lower right pane. Find THIS_MLM_NAME and you will find (SETQ THIS_MLM_NAME 'USERNAME-302364198::MLM_NAME) . From this, you can see that the variable was set equal to the explicit / unvalued Lisp expression, and not the string that would look like (SETQ THIS_MLM_NAME "USERNAME-302364198::MLM_NAME") .
ErikE
source share