reg
YaBB Newbies
Offline
Posts: 7
Did "join" get broken?
Jun 6th , 2005, 3:54pm
Hi all. Having some issues porting code from alpha. Did the "join" command get broken since alpha? This is the REFERENCE text from the website: // works identically with float[] and String[] int list[] = new list[3]; list[0] = 8; list[1] = 67; list[2] = 5; String formatted = join(list, ", "); // formatted now contains "8, 67, 5" There is a typo in the above. This version works in alpha: // works identically with float[] and String[] int list[] = new INT [3]; list[0] = 8; list[1] = 67; list[2] = 5; String formatted = join(list, ", "); // formatted now contains "8, 67, 5" However, it doesn't work in BETA (0087). I think this is partly because 'list' has become a declared variable or somesuch, but also it seems that "join" works for Strings but is now broken for joining any array of ints or floats. For example: int myList[] = new int[3]; myList[0] = 8; myList[1] = 67; myList[2] = 5; String formatted = join(myList, ", "); Yields: C:/..../Application Data/Processing/build/Temporary_7986_4172.java:7:20:7:37: Semantic Error: No applicable overload for a method with signature "join(int[], java.lang.String)" was found in type "processing.core.PApplet". Perhaps you wanted the overloaded version "java.lang.String join(java.lang.String[] $1, java.lang.String $2);" instead? Similarly the reference float example doesn't work: float f[] = new float[3]; f[0] = 1.3; f[1] = 92.8; f[2] = 0.7; // 3 digits on the left of the decimal point // 2 digits to the right of the decimal point String zerofloats = join(f, " ", 3, 2); Yields: C:/...../Application Data/Processing/build/Temporary_6114_4672.java:7:21:7:38: Semantic Error: No applicable overload for a method with signature "join(float[], java.lang.String, int, int)" was found in type "processing.core.PApplet". Perhaps you wanted the overloaded version "java.lang.String join(java.lang.String[] $1, java.lang.String $2);" instead? Or has this been spotted already? Might be worth changing the reference text to not use "list" either way... TC, R