Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reg:Create object as well as appending with data : x type table of ref to y

Former Member
0 Kudos

Hi

I have coded like this to create an object based on the class definition.


data : instantiation_1 type ref to counter,
       instantiation_2 type ref to counter,
       instantiation_3 type ref to counter,
       instantiation_tab type table of ref to counter.

 create object : instantiation_1,
                       instantiation_2,
                      instantiation_3.

 append : instantiation_1 to instantiation_tab,
              instantiation_2 to instantiation_tab,
              instantiation_3 to instantiation_tab.
 

And when i see it in the debugger i am getting the values like this under instantiation tab


{O:3*\PROGRAM=YHPAP004_TEST\CLASS=COUNTER}
{O:5*\PROGRAM=YHPAP004_TEST\CLASS=COUNTER}
{O:6*\PROGRAM=YHPAP004_TEST\CLASS=COUNTER}

Can any one please explain me how to understand over the above values??

Thanks

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello Arun

The most important thing about your observation is that you can individual instances of the same program object (here: your class) within the same application. This is not possible with e.g. function groups. Or to put it into other words: You can have only a single "instance" of a function group (and its modules) within the same application.

Regards

Uwe

3 REPLIES 3

former_member69765
Contributor
0 Kudos

What is that you want to understand here ??

Note : When we create an instance of the object - In program we can use it like variables, but in the memory it acts like a object that encapsulates all attributes and its method...

It is like a memory area... so In debugging what you see is just like some kind of address of that memory area (not exactly memory address... but its hard to put in words... )...

If you double click on that... you can see the attributes of that object and their values..

What else you want to understand ?

Former Member
0 Kudos

For objects that are accessed through reference (object instances, data references etc), the debugger shows contents as u have shown

The class instances are represented by

where

O specifies that it is a object (class instance)

n is the internal identification number

class_name specifies the name of the class. (for local classes, program name is also listed.)

~Piyush Patil

uwe_schieferstein
Active Contributor
0 Kudos

Hello Arun

The most important thing about your observation is that you can individual instances of the same program object (here: your class) within the same application. This is not possible with e.g. function groups. Or to put it into other words: You can have only a single "instance" of a function group (and its modules) within the same application.

Regards

Uwe