TechTip: Debug a Pointer's Value PDF Print E-mail
Tips & Techniques - Programming
Written by Barbara Morris   
Sunday, 15 September 2002 18:00

When debugging ILE RPG code, to see what a pointer is pointing to, you can use :x or :c when using the EVAL debugger command on the pointer itself. This means you can debug a pointer's value without having an RPG BASED variable.

This shows the first 10 bytes that "ptr" is pointing to, as character data:
===> EVAL ptr:c 10

This shows the first 10 bytes that "ptr" is pointing to, in hex:
===> EVAL ptr:x 10

This is useful when the pointer is pointing to data that is not readable as
character data--for example, packed data. If ptr is pointing to a packed
field with the value 12345, ptr:x 3 would show you X'12345F'.

--Barbara Morris
bmorris@ca.ibm.com


Barbara Morris
About the Author:

Last Updated on Thursday, 11 June 2009 16:42
 

You must be logged in to view or make comments on this article.


User Rating: / 0
PoorBest 

   MC-STORE.COM