• Post Reply Bookmark Topic Watch Topic
  • New Topic

Inserting Object with 2 Attributes into an array  RSS feed

 
Dennis Von Valkenburgh
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
in the following Method:


Im not exactly sure how to add the Object into the array. My confusion is caused by the two separate parameters of name and labor (Name represents the name of the Rooms to add, and labor represents whether the room is a laboratory or not (True for it is a laboratory and false for it is not))
The object Room is made up of the parameters name and labor.
Im not exactly sure how to add the two.
Do you have any pointers or hints at how this can be accomplished?
Thanks
 
Dennis Von Valkenburgh
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The adding has to go in the else block of the if statement.
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is your array?

Don't use labor as the name of a boolean. It is very confusing particularly in an American website where it means hard work. Use something like isLaboratory, or whatever that would be in your language.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!