what is pointer error in rpg IV?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to add 99 menu (page down) option in menu creation..

1923


a multiple format logical file is also known as?

597


how many files, printer files you can describe in a rpg?

632


the maximum number of subfiles that can be active for a single file is ____ .

1183


What is array in as400? What are the types of array?

627






http default port 80 is used by some other production http service. How can I create an http instance on another port to run cgidev2 and my future cgi developments?

592


name few ibm supplied libraries?

1227


what is the difference between normal upddta to pf and updating using dfu program?

769


what would be the effect on the field where reverse image, underline and highlight display attributes were active?

941


How can we change the uppercase to Lowercase in RPG?

933


Difference Between Skip Before & Space Before?

674


Service Program : S1 Modules in S1 : M1 M1 having two procedures : ADD, SUB Current Binder Language STRPGMEXP PGMLVL(*CURRENT) EXPORT SYMBOL("ADD") EXPORT SYMBOL("SUB") ENDPGMEXP Doubt: I need to add one new Module to the Service Program M2 having one procedure ‘MULT’ How to add this new module to the service program S1 ? If I need to recreate the service program again, Do I need to mention the Module M1 again while recreating along with new Module M2? There is no Binding Directory. Binder language structure will be like this STRPGMEXP PGMLVL(*CURRENT) EXPORT SYMBOL("ADD") EXPORT SYMBOL("SUB") EXPORT SYMBOL("MULT") ENDPGMEXP STRPGMEXP PGMLVL(*PREVIOUS) EXPORT SYMBOL("ADD") EXPORT SYMBOL("SUB") ENDPGMEXP

1933


Which command is used to replace CDUP command in FTP IF i WANT TO USE SFTP?

1784


which of the cl command can be used to determine which logical files are dependent on a specific file?

593


What Is The Purpose Of The "n" In The Following Calculation Specification?

676