× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



So is the "no exception when adding to a *Null pointer" behavior by design
of RPG or a bug?  I dont find a mention in the RPG reference manual.

thanks,

Steve Richter

-----Original Message-----
From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On
Behalf Of Barbara Morris
Sent: Wednesday, October 16, 2002 12:37 PM
To: rpg400-l@midrange.com
Subject: Re: add to *Null pointer does not throw an exception.


Jim Langston wrote:
> ...
> Do we know for a fact how a Null pointer is handled in RPG?  Do we know,
for a fact, wither it is pointing to 0, or does it have a Null bit set?
> ...

There isn't any special RPG-ish way of dealing with pointers.  On the
as/400 (*), a pointer is a combination of 2 things: a 16 byte value with
offsets etc, PLUS a bit somewhere in the system that says that
particular 16 bytes really is a pointer.  A pointer is null if that bit
is not set.  You set the bit on by doing a pointer operation on the 16
byte value (say assigning to the pointer).  You set the bit off by
explicitly assigning *NULL or by changing the 16 bytes in a non-pointer
way (say you have the pointer in a data structure, and you assign to a
character overlay of the pointer, although this may or may not
invalidate the pointer if what you assign has a pointer in it).

(*) This whole thing may not apply to teraspace pointers.


_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.