We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, I'm fairly new to Processing and I'm using OscP5 to send processing data to max/msp. I don't know if this is possible but I'm trying to create something like an array of NetAddresses so that I can transmit separate ports of data to max.
I know Java/processing doesn't handle dynamic variables but I was wondering if there was a way to go about creating a variable number of NetAddresses perhaps in some type of loop. More specifically, I want to be able to make separate NetAddresses with a variable number of ports 'on the fly' during runtime. Is this even possible?
Please let me know if this doesn't make any sense.
Answers
Variables are the most basic value holder in any programming language! They can store up 1 value only! >-)
To overcome that, variables can be made to point/refer to a more complex structure object;
like an Array, ArrayList or HashMap, etc. In other words, variables store the physical memory address to objects! (*)
So, what you can do is choose an appropriate data-structure, and make a variable point to it.
After that, you can store as many instance references of NetAddress objects as you want in that structure by using that variable. =:)