MakeMDMName
This function replaces characters in a text string that are not allowed in the name of an MDM object, to produce a valid name.
Syntax
MakeMDMName(Val)
Parameters
Val
Type: Text
Text value to encode.
(return)
Type: None
Copy of Val with changes to make it a valid name for an MDM object.
Remarks
The following changes are made:
▪Leading and trailing spaces are removed.
▪Null, blank, or empty names are converted to "No_name__".
▪Any occurrence of the character # is replaced by #23 (23 is the hexadecimal representation of the Unicode character code for #).
▪Any character that is not allowed anywhere in an MDM name is replaced by # followed by its two-digit hexadecimal character code.
▪If the resulting text starts with any character that is not allowed at the start of an MDM name, then the string _#00 is inserted at the start of the text.
These conversions ensure that:
▪the resulting text is a valid MDM name
▪different input strings always produce distinct output strings
▪it is possible to "decode" the resulting text to get the original (although no library function is provided to do this).
Examples
SPSS\username becomes SPSS#5Cusername
user@domain.com becomes user@domain#2Ecom
\\computer\file becomes _#00#5C#5Ccomputer#5Cfile
Neither agree nor disagree becomes Neither#20agree#20nor#20disagree
12 becomes _#0012
Under $12 becomes Under#20$12
See also