如何在Xtend中完成此循环?
for (char character = '\0'; character != PacketConstants.STRING_TERMINATOR; character = (char) buffer.get())
我已经阅读了文档并尝试了几种不同的东西,我无法让它工作。
答案 0 :(得分:1)
Xtend中没有for(;;)
循环。您应该使用while
循环代替:
var char character = 0 as char
while (character != PacketConstants.STRING_TERMINATOR) {
character = buffer.get() as char
}