|
Prev: Inspect tallying?
Next: Fujitsu adtools.com
From: Frank Swarbrick on 17 Jul 2006 14:34 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
From: William M. Klein on 17 Jul 2006 15:44 USAGE 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(a)earthlink.net> wrote in message news:4LQug.728$bP5.698(a)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 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
From: Frank Swarbrick on 17 Jul 2006 20:21 William M. Klein wrote: > USAGE 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). 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
From: William M. Klein on 17 Jul 2006 23:34 The whole point of the SET Up / Down by is to do the EQUIVALENT of arithmetic - 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 to do a DISPLAY on them. -- Bill Klein wmklein <at> ix.netcom.com "Frank Swarbrick" <infocat(a)earthlink.net> wrote in message news:44BC297A.3020507(a)earthlink.net... > William M. Klein wrote: >> USAGE 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). > > 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
From: Howard Brazee on 25 Jul 2006 10:30 On Tue, 18 Jul 2006 03:34:18 GMT, "William M. Klein" <wmklein(a)nospam.netcom.com> wrote: >The whole point of the SET Up / Down by is to do the EQUIVALENT of arithmetic - >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 Usenet.com Premium Usenet Newsgroup Services ---------------------------------------------------------- ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY ** ---------------------------------------------------------- http://www.usenet.com
|
Pages: 1 Prev: Inspect tallying? Next: Fujitsu adtools.com |