Hi. I have some questions regarding the wait() function in brightscript. The function takes 2 parametres: timeout (ms) and MessagePort. Timeout 0 means wait forever until message is received. The following code is from one of the example scripts, and it is used to check if the video is finished playing:
listen: msg = wait(2000,p) if type(msg) = "roVideoEvent" and msg.GetInt() = 8 then sleep(1000) goto start endif goto listen My questions are: - can't you risk, that the video stops playing exactly when the wait-function is timed out and before it returns to listen? - and is there any reason for not using wait(0,p) in this case? - and even if you used wait(0,p), wouldn't you risk missing the right message, if another message is received just before? Best regards Jakob.