TechTip: Debug a Pointer's Value

General
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times
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
This email address is being protected from spambots. You need JavaScript enabled to view it.

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$0.00 Raised:
$