Menu

#554 Literal string containing hex 1A get error message

closed
None
5
2014-12-14
2008-11-02
oorexxpert
No

Literal text string are suppose to have any character except a line feed (X'10') according to the reference book. Actually, according to my documentation, a line feed character is actually a decimal 10 (x'0A').

I have an assignment statement that assigns a literal string to a variable:

   a = "";

The character in quotes is actually a hexadecimal '1A' character which should be allowed. However, when executing REXX against the program, I receive the error:

Error 6 running C:\Documents and Settings\John Bodoh\My Documents\IRC\REXX\testrexx.REX line 1: Unmatched "/*" or quote
Error 6.3: Unmatched double quote (")

Discussion

  • oorexxpert

    oorexxpert - 2008-11-02

    I have found some other interesting information. The '1A'x seems to terminate the program. That's why the error messsage talking about the missing quote. I get the same message if the '1A'x is within a comment.

    There must be a restriction about using this value in a literal string. If so, it should be documented. I wonder what other undocumented characters cause errors?

     
  • Rick McGuire

    Rick McGuire - 2008-11-02

    The x'1a' is an end-of-file marker that is processed before source characters are even examined. The handling of line end characters is in the same category. It might be possible to remove the processing of the 0x1a entirely, but only at the risk of breaking existing programs. The work around for this is to use a hex literal to specify control-type characters.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB