A
Analog_Guy
Guest
I have written a function to pad an input string with NUL to the
chosen string width (set by a constant):
SUBTYPE NAMETYPE IS STRING(1 TO STRING_WIDTH);
FUNCTION pad_string (name : STRING) RETURN NAMETYPE IS
VARIABLE name_pad : NAMETYPE;
BEGIN
name_pad(1 TO name'LENGTH) := name;
name_pad((name'LENGTH + 1) TO name_pad'LENGTH) := (OTHERS => NUL);
RETURN name_pad;
END FUNCTION pad_string;
The FUNCTION works fine, and I can now pass the string to and from
modules through records. However, when I try to use an ASSERT ...
REPORT to print out some NOTES, nothing prints out after the
concatenated record element.
ASSERT (FALSE)
REPORT "*** Signal of Interest: " & reset_cmd.name & " end of
line!"
SEVERITY NOTE;
The final "end of line!" text does not print??? If I substitute
whitespace into the FUNCTION instead of the NUL, then the full REPORT
line prints to the screen. Is the NUL in the reset_cmd.name killing
the rest of the line, and why?
chosen string width (set by a constant):
SUBTYPE NAMETYPE IS STRING(1 TO STRING_WIDTH);
FUNCTION pad_string (name : STRING) RETURN NAMETYPE IS
VARIABLE name_pad : NAMETYPE;
BEGIN
name_pad(1 TO name'LENGTH) := name;
name_pad((name'LENGTH + 1) TO name_pad'LENGTH) := (OTHERS => NUL);
RETURN name_pad;
END FUNCTION pad_string;
The FUNCTION works fine, and I can now pass the string to and from
modules through records. However, when I try to use an ASSERT ...
REPORT to print out some NOTES, nothing prints out after the
concatenated record element.
ASSERT (FALSE)
REPORT "*** Signal of Interest: " & reset_cmd.name & " end of
line!"
SEVERITY NOTE;
The final "end of line!" text does not print??? If I substitute
whitespace into the FUNCTION instead of the NUL, then the full REPORT
line prints to the screen. Is the NUL in the reset_cmd.name killing
the rest of the line, and why?