outlet array of Atoms or primitive types as a single symbol.
Hi all,
say I have the following method in a class:
public void bang() {
Atom[] a = new Atom[] {Atom.newAtom("my"), Atom.newAtom("god")};
outlet(0, a);
}
This will give me a list:
my god
If I wanted to output a single symbol, the way I did it up to now was:
Concatenate Integers, Floats and Strings to a String literal like so:
//stupid example:
public void bang2() {
String[] a = new String[] {"my", "god"};
outlet(0, "" + a[0] + " " + a[1] + " " + new Integer(1).toString() + " " + Atom.newAtom(1.0f).getFloat().toString());
}
Getting: "my god 1 1."
Is there a way to somehow say: "I just want a symbol out of this blob of Atoms" or whatever, without having to convert to String, like [tosymbol]?
like a method: .toSymbol(Atom[] stuff)? Should I roll my own? (I don't mind)
Or is a Java String like "i am here 1 2" == Symbol in max when it hits the outlet (this is my assumption)?
Help greatly appreciated (btw the .pdf for writing externals for mxj does not
mention something as far as I can tell).
Panos