07-02-2013 04:45 AM
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!
07-02-2013 06:24 AM
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.
06-15-2017 02:51 PM
This thread is very, very old, but I wanted to point out that an object IS an instance of a class.