gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] Re: 0 bytes in Cobol strings


From: David Korn
Subject: [open-cobol-list] Re: 0 bytes in Cobol strings
Date: Fri Apr 2 09:21:11 2004

Subject: Re:  0 bytes in Cobol strings 
--------

It looks like the ability to handle a 0 byte would be hard with the
current code since it uses fgets() to do reads.  I have another
suggestion.

Perhaps the compiler should allow the first line of the file to contain
information to specify a character which will be mapped into \0 in
output_string() in codegen.c.

For example if the first line contains
-ZERO   0x1
then this line would be used by the compiler so that when the byte
0x1 is output in a string, it would be output as \0 in C.

This way I can eliminate all the 0 bytes from the MVS source code by using
tr to conver them to another byte and prepend the line with the character
number that 0 has been mapped into.

Since you currently skip lines with PROCESS, another choice would be
        PROCESS ZERO(1)
instead of
        -ZERO   0x1



David Korn
address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]