Hi Brandon,
ha, I see why. From the manual, the section on the output parameter kans:
If multiple messages are received in a single control period, the messages are buffered, and OSClisten can be called again until zero is returned.
So you run the while - or any other - loop, for that eventuality.
Personally, I would use a while loop, perhaps:
while kans != 0 do
kans, kdata[] osclisten ...
; handle your data somehow
done
HTH.
Best wishes,
Jeanette