Reputation: 124
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.
Upvotes: 0
Views: 431
Reputation: 39536
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
}
Upvotes: 1