|
>Date: Thu, 25 May 2000 08:27:29 -0400 >From: jpcarr@TREDEGAR.COM > >>What happens if you then change the length of the field back to 6? > >Suprisingly I think you will see the '12345' again. I don't think >it should work this way. > ... It doesn't work that way ... The reasoning is that the value of bytes after the current length is undefined. (For example, the compiler doesn't initialize the whole field, or copy the whole field from the buffer on input.) Anyway, if the length of a varying field is increased, the additional characters are set to blanks. This behaviour can be awkward if you actually want the data to stay the same and the length to go up and down, but we thought it would be more usual that programmers would have garbage in those bytes and would not always be lucky enough to find out about the random garbage in their fields during testing rather than after putting their code into production). Barbara Morris, IBM Toronto Lab, RPG Compiler Development +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.