If the pointer has not yet been set, you will get an error or a wildly inaccurate result.
If the variable or the pointer is defined in a subprocedure, trying to see the value outside of that procedure will give you an inaccurate result.
As for WATCH, try not to use it if you can use another method, since WATCH is system-wide (you can only have 16 Watches at a time in the whole machine!) and it is very hungry for system resources. Instead, look through the source and place breakpoints where the variable you are interested in changes.
Note: I tend to use STRDBG for interactive debugginging of ILE programs, and this behaves correctly with basing pointers. I do not know whether STRISDB behaves in the same way. If you are debugging non-ILE programs, there shouldn't be any pointer data types in them anyway. If you have problems with STRISDB and basing pointers in ILE programs use STRDBG instead.
MORE INFORMATION ON THIS TOPIC
The Best Web Links: tips, tutorials and more.
Visit the ITKnowledge Exchange and get answers to your developing questions fast.
Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.
Dig deeper on iSeries application development tools
Related Q&A from John Blenkinsop
When an error occurs on an IBM command, the diagnostic messages are sent first, then an escape message, which you can monitor. On AS/400 you see the ...continue reading
Learn how to 'append data to the file' with the FTP DIR command, and eliminate the hassle of having to end the FTP session and restart to view ...continue reading
RPGIV will 'think of' incoming integer fields as binary, and then will redefine them in the program structures as PACKED. So, when you chain a record...continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.