|
M Hello Leif, You wote: >===>apart from why the compiler does it stuff, how is >the callee to know that you are calling it with a longer >or shorter return value? Because it doesn't care. RETURNing a value from a procedure is like a MOVE operation. The compiler takes care of the differences and it stops with the shortest field. The callee simply returns as much data as it has and the receiving variable only gets as much as it has room for. This allows the callee to make guesses based on the size of the input values. Assuming the programmer making the call understands that on this call 10 bytes will be returned and on the next call 100 bytes will be returned then everything is fine. What irritates me is that the COBOL compiler will allow the calls to have different return sizes -- just not in the same module. That is obviously an artifical constraint imposed by the compiler writers trying to be too clever by half. I guess I want to know if other COBOL programers find this behaviour weird too. In which case I might open a PMR. Regards, Simon Coulter. «»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«» «» FlyByNight Software AS/400 Technical Specialists «» «» Eclipse the competition - run your business on an IBM AS/400. «» «» «» «» Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\ «» «» Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au \ / «» «» X «» «» ASCII Ribbon campaign against HTML E-Mail / \ «» «»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«» +--- | This is the COBOL/400 Mailing List! | To submit a new message, send your mail to COBOL400-L@midrange.com. | To subscribe to this list send email to COBOL400-L-SUB@midrange.com. | To unsubscribe from this list send email to COBOL400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---END
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.