LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating multiple instances of a class in LabVIEW object-oriented programming

How do you create multiple instances of a class in a loop?  Or am I thinking about this all wrong?

 

For instance, I read in a file containing this information:

 

Person Name #1

Person Age #1

Hobby #1

Hobby #2

Hobby #3

 

Person Name #2

Person Age #2

Hobby #1

Hobby #2

Hobby #3

 

Person Name #3

Person Age #3

Hobby #1

Hobby #2

Hobby #3

 

If I define a Person class with name, age, and an array of strings (for the hobbies), how can I create several new Person instances in a loop while reading through the text file?

 

FYI, new to LabVIEW OOP but familiar with Java OOP.  Thank you!

0 Kudos
Message 1 of 3
(3,047 Views)

First of all, let's get your terminology correct.  You are not creating multiple instances of a class.  You are creating Objects of the class.

 

Use autoindexing to create an array of your class type.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 3
(3,033 Views)

This thread is very, very old, but I wanted to point out that an object IS an instance of a class.

Using Labview 2022, Windows 10
Message 3 of 3
(2,596 Views)