Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

DISPLAY pointer
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

Report this thread to moderator Post Follow-up to this message
Old Post
Frank Swarbrick
07-17-06 11:55 PM


Re: DISPLAY pointer
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@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



Report this thread to moderator Post Follow-up to this message
Old Post
William M. Klein
07-17-06 11:55 PM


Re: DISPLAY pointer
William 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

Report this thread to moderator Post Follow-up to this message
Old Post
Frank Swarbrick
07-17-06 11:55 PM


Re: DISPLAY pointer
The 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



Report this thread to moderator Post Follow-up to this message
Old Post
William M. Klein
07-18-06 02:55 AM


Re: DISPLAY pointer
On 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

Report this thread to moderator Post Follow-up to this message
Old Post
Howard Brazee
07-25-06 11:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:29 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.