☜ | DefinitionsAnnotations | ☞ |
The texts for the 1995 and MDC standards mention the “null string”.
Note that a null string in a language like C looks like:
char str [] = {0};
or
char str [] = "";
and is stored in memory as an array or “short integers”,
where the array length is 1 element, and the value of that
element is 0 (zero).
In M[UMPS], however, one can Set str=$Char(65,66,0,67,0,68) and thus create a string that consists of 6 characters, two of them being the control-character commonly known as “the NULL character”.
If a C program would create a string like
char str [] = {65, 66, 0, 67, 0, 68};
the length of that string would be considered to be 2 (two)
characters, and the string-related functions of the language
would not “see” beyond the first &;dquo;null” character.
Since it is possible in M[UMPS] to have a string that is equal to $Char(0), the meaning of the term “null string” is considered to be ambiguous (it can mean either a string of zero characters, or a string of one character, that character being the NULL character). As a result, the standard does not use the term “null string” in any of the formal parts, but instead uses the term “empty string” when referring to a string consisting of 0 (zero) characters. When referring to the other possible meaning, the standard refers to the ASCII NULL character.
Copyright © Standard Documents; 1977-2024 MUMPS Development Committee;
Copyright © Examples: 1995-2024 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2024 Ed de Moel.
Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.
This page most recently updated on 16-Nov-2023, 17:33:38.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)