what is pointer error in rpg IV?
Answers were Sorted based on User's Feedback
Answer / syam
Parameters are passed between RPG or CL programs, they are
actually passed as pointers, not data. Pointer is a
variable that contains the address of another variable
Either parameter missing or parameter mismatch.
| Is This Answer Correct ? | 11 Yes | 0 No |
Answer / szeke
As i know pointers are only simple memory adresses stored in variables. There are many situation they can be used, not only passing parameters. APIs from C, dynamically allocated variables, structures.
A %TRIMR can be a pointer in the original field instead of building another instance of it. Working with orbital buffers, parsing them, break into separated fields, from another ILE language or module can be received and send by a number of pointers instead of copy the value.
Doing anything with a pointer value doesn't point to the correct location is a pointer error. All the data types represent pointers anyway, but they maintained by the compiler, not by the programmer. To forget freeing unused pointed memory areas is another type of error. The use of pointers can cause such errors like invalid data, or memory leaks, since the compiler has no idea what we store on that variable, it must believe we're right. In java, the compiler strictly checks an array out of bound pointer operation, in C++ i have the right to browse the whole memory from a simple a[2] defined array by adressing it as a[12345]. Also no expensive type checkings, so the performance is better.
I can erase a value, or don't even initialize it in the memory but the pointer will still exist and pointing into a non-defined value.
The instruction pointer is also a pointer, can be manipulated by GOTO jumps, or Subs, OOP programming languages are just abstract definitions over the same thing, basically every procedure will be called by its pointer in the memory, determined by compiler or the user, in compile time or run-time... It is called procedure pointer. To point into a variable instead of a PROC is another serious error...
So, what is the question exactly?
| Is This Answer Correct ? | 0 Yes | 0 No |
why do we use readc? What is sflnxtchg?
what is subfile?
What is the purpose of the following? A CSRLOC (F1ROW F1COL)
where will control be passed after the execution of the *pssr subroutine if the factor2 of the endsr is blank ?
The content of Physical file is as below: hfcftp wruquief SENDPASV 0 CDUP ASCII GET 01100901.CSV ramndk/ECP505.EC0110090 (REPLACE QUIT Thw above commands will get executed when we call STRTCPFTP from CL program.... Now if I want to use SFTP what can be the solution? plz reply in detail....Thank you for ny help... I m using RPG/ILERPG to download...
what does vldcmdkey means?
What is SFLPAG
What is the purpose of Level Check parameter in a Physical file?
What are the mandatory keywords of sub file?
what are the limitations of cl (compare to rpg) ?
how can database records be read without lock ?
How can we sort an array?