Code Comments
Programming Forum and web based access to our favorite programming groups.From ISO/IEC 1989:2002(E): "14.8.10 DISPLAY statement The DISPLAY statement causes data to be transferred to an appropriate hardware device." "14.8.10.2 Syntax rules FORMAT 1 1) Identifier-1 shall not reference a data item of class object or class pointer." Adding some "sanity checking" to OpenCOBOL. It currently supports DISPLAY of data items defined as USAGE POINTER. Why is this not supported by the standard? Even little COBOL/VSE supports it (as an extension), and I'm just wondering why its explicitly disallowed in the standard. I suppose its because a pointer is a reference to something rather than a something itself, but I just don't see that as being a valid reason. Frank Swarbrick
Post Follow-up to this messageUSAGE POINTER items are often (usually? almost always?) stored as an address . HOWEVER, they are not required to be stored this way. Therefore, there is nothing to say that "DISPLAYing" what is in a USAGE POINTER item makes any sense. (In theory, it could be the name of the monk who has his finger pointing to the correct place; not likely, but allowed by the Standard). This is also why the Standard doesn't allow one to do "arithmetic" directly on a USAGE pointer data item. -- Bill Klein wmklein <at> ix.netcom.com "Frank Swarbrick" <infocat@earthlink.net> wrote in message news:4LQug.728$bP5.698@newsread1.news.pas.earthlink.net... > From ISO/IEC 1989:2002(E): > > "14.8.10 DISPLAY statement > > The DISPLAY statement causes data to be transferred to an appropriate hard ware > device." > > "14.8.10.2 Syntax rules > > FORMAT 1 > > 1) Identifier-1 shall not reference a data item of class object or class > pointer." > > Adding some "sanity checking" to OpenCOBOL. It currently supports DISPLAY of > data items defined as USAGE POINTER. Why is this not supported by the > standard? Even little COBOL/VSE supports it (as an extension), and I'm ju st > wondering why its explicitly disallowed in the standard. I suppose its > because a pointer is a reference to something rather than a something itse lf, > but I just don't see that as being a valid reason. > > Frank Swarbrick
Post Follow-up to this messageWilliam M. Klein wrote: > USAGE POINTER items are often (usually? almost always?) stored as an addre ss. > HOWEVER, they are not required to be stored this way. Therefore, there is > nothing to say that "DISPLAYing" what is in a USAGE POINTER item makes any > sense. (In theory, it could be the name of the monk who has his finger > pointing to the correct place; not likely, but allowed by the Standard). Nonetheless, even if the pointer is the name of a monk who has his finger pointing to the correct place, there would still be a unique monk for each pointer, and therefore his name might be useful. :-) > This is also why the Standard doesn't allow one to do "arithmetic" > directly on a USAGE pointer data item. What about SET FORMAT 9 (data-pointer-arithmatic)? SET MY-ADDR UP BY 1 Frank
Post Follow-up to this messageThe whole point of the SET Up / Down by is to do the EQUIVALENT of arithmeti c - without actually doing it. What you can't do is Add +1 to Ptr-Item P.S. I think that the restriction on DISPLAY goes back to 16-bit "DOS" (PC- type DOS, not IBM pre-VSE DOS). Those addresses were pretty "odd" if you tried t o do a DISPLAY on them. -- Bill Klein wmklein <at> ix.netcom.com "Frank Swarbrick" <infocat@earthlink.net> wrote in message news:44BC297A.3020507@earthlink.net... > William M. Klein wrote: > > Nonetheless, even if the pointer is the name of a monk who has his finger > pointing to the correct place, there would still be a unique monk for each > pointer, and therefore his name might be useful. :-) > > > What about SET FORMAT 9 (data-pointer-arithmatic)? > SET MY-ADDR UP BY 1 > > Frank
Post Follow-up to this messageOn Tue, 18 Jul 2006 03:34:18 GMT, "William M. Klein" <wmklein@nospam.netcom.com> wrote: >The whole point of the SET Up / Down by is to do the EQUIVALENT of arithmet ic - >without actually doing it. I thought it was just the opposite: to do Arithmetic, but not using the language we're used to. Posted Via mcse.ms Premium Usenet Newsgroup Services ---------------------------------------------------------- ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY ** ---------------------------------------------------------- http://www.mcse.ms
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.