I don't think that this actually works on unidata either. It may
appear to work because unidata ignores the part after the invalid space.
Multiple conversions in oconv/iconv or in a-type dictionary lines 7
and 8 or I/D-type dictionary line 3 always need to be separated with
value marks. Using a different pair of conversions:
0001 X='123abc'
0002 CRT OCONV(X,"MCA MCT")
0003 CRT OCONV(X,"MCA":@VM:"MCT")
unidata says:
abc
Abc
The second oconv with a value mark is correct, and the first with a
space fails on unidata.
Looking at the original conversion, "MX MD0Z":
On most multivalue platforms, MX converts a string to a text hex
equivalent, i.e:
OCONV(char(7):'0',"MX")
will return 0730. This is usefull for encoding a string with binary
characters. This works on unidata, but only if BASICTYPE is "P", not
in the default unidata emulation. On cache, you can use "MX0C" (also
works on unidata) or "MCAX" if this was the intention.
However, on unidata ideal, and on universe ideal, "MX" converts
numeric from decimal to hex. OCONV("12","MX") returns A; oconv
("1234","MX") returns 4D2. Note the difference here between this and
the other meaning of "MX". On d3/universe pick/unidata in basictype
"P", OCONV("1234","MX") returns 313233, converting each character to a
2-character hex equivalent. On unidata ideal, OCONV("1234","MX")
returns 4D2, converting a decimal number to hex. This second meaning
is probably what your code intends to do.
The second code, "MD0Z" trims leading zeros and rounds to 0 decimal
places. As far as I can tell, it's superfluous, because MX doesn't
return leading zeros, and truncates decimals.
Because MX is ambiguous, and MD0Z is superfluous, I'd suggest
replacing the conversion with "MCDX" which converts decimal to hex on
all platforms and emulations.
Isn't it nice the way Cache complains about invalid conversion codes
instead of just ignoring them like unidata?
> --
> You received this message because you are subscribed to the Google
> Groups "InterSystems: MV Community" group.
> To post to this group, send email to
Cac...@googlegroups.com
> To unsubscribe from this group, send email to
CacheMV-u...@googlegroups.com
> For more options, visit this group at
http://groups.google.com/group/CacheMV?hl=en