Question

How would this loop be done in Xtend?

for (char character = '\0'; character != PacketConstants.STRING_TERMINATOR; character = (char) buffer.get())

I have read the documentation and tried several different things, I cannot get it to work.

Was it helpful?

Solution

There is no for(;;) loop in Xtend. You should use while loop instead:

var char character = 0 as char
while (character != PacketConstants.STRING_TERMINATOR) {
    character = buffer.get() as char
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top