× 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.



I appreciate the input.

After yesterday's posting (and during a moment of insight while getting
ready for work this morning) I realised I was after two separate things.
1) To know if a series of sub procedures was returning a pointer value
to me correctly and 2) The more 'just because I want to' question of how
to display the value of a pointer.

>From the feedback I've gotten I decided to validate my procedures by
displaying a value out of the user space I create - something from the
header for example - that is based on the pointer returned by the
routine. This would be a much better test of the success of creating the
user space and the validity of the pointer.

For the 2nd point - I'll still mess with the code to display a pointer.
Why? Because it's there (and I didn't know how to before) ;-)

And Jon - As far as why I'm returning the pointer... I need it. After
creating the user space, I'll need the pointer to base the Generic
header format 0300 DS on.
I found myself always doing the same steps: 1) calling QUSCRTUS to
create the user space, calling QUSPTRUS to get the pointer to it,
calling (among others) QUSLOBJ to list some objects into the space, then
using the info in the Gen Head 0300 (based on the pointer) to start
playing....

I decided to write myself a procedure that will combine the first two
steps into one - create the space and return the pointer to it if
successful. Then, having the pointer I have control over how to use the
generic header data depending on my needs. I see very little use for
creating a user space and not getting the pointer to it.

Thanks again for all the input.

Best Wishes

Jim Wiant

-----Original Message-----
From: rpg400-l-bounces+jim.wiant=foodstuffs.co.nz@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+jim.wiant=foodstuffs.co.nz@xxxxxxxxxxxx] On
Behalf Of Jon Paris
Sent: Wednesday, 2 November 2005 17:36
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: Displaying/Printing a pointer value


 >> I'm looking for a way that I can display or print the value of a
Pointer
in RPG IV.

Simply map it to a character field (or multiple integers for that
matter)
via a DS.  You still won't be able to "prove" that it is a valid pointer
since there is no way to directly incorporate the tag bit but ... I
guess if
it were critical you could incorporate a test for *NULL and output that
information too.

However, seeing the pointer value is pretty useless information - it
doesn't
even really help in testing even since the data it points to may be the
same - but the address of the pointer different.  Since a pointers
purpose
is to "point" to data - why not simply dereference the pointer (i.e. use
it
as a basing pointer) for an arbitrary field and display the content of
that
field?  I would think that seeing if the data matches is far more useful
than knowing the value of the pointer anyway.

I also wonder why you'd return a pointer in the first place - but that's
for
another day.

Jon Paris
Partner400

www.Partner400.com
www.RPGWorld.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.