Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1559

List of Class Objects

$
0
0

I know you can do this with invoke, list and add but can it be done with traditional cobol.  I want to create a list of class objects.  So I have a class that consists of student information

These all have properties set.

class-id TO_Students.
       Working-Storage Section.
               01  _studentname                     pic x(30)      private.
               01  _studentid                       pic x(9)       private.
               01  _studentmajor                    pic x(11)      private.
               01  _studentclassification           pic x(9)       private.
               01  _studentsexcode                  pic x(6)       private.
               01  _studentgpr                      pic 9(1)V9(4)  private usage comp-3.
               01  _majorcount                      pic 9(2)       private.
               01  _classcount                      pic 9(2)       private.
               01  _sexcount                        pic 9(2)       private.

Then in another cobol program I create an instance of this with a list.  So I have.

01  tso type List[type TO_Students].

 

When I create the list with these objects, I invoke::tso::Add(new TO_Students(prop StudentName...) etc.

How can this be done in a traditional cobol manner wherein I create tso, then write tso with the objects.


Viewing all articles
Browse latest Browse all 1559

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>