Possible bug in compare?

Posted By: kiamonster

Possible bug in compare? - 04/02/10 18:00

I just ran the update tp 7.82.

I tend to code the full statement (no shortcuts)
so I coded (x coder and easier to debug at 3 am if '== 1'
is included)

wh2 = snd_play(w_xtable, svol,0);
while(snd_playing(wh2) == 1) {wait(1);}

This previously worked, so I was surprised when it
stopped working after the update.
The below (no '==1' does work however.

wh2 = snd_play(w_xtable, svol,0);
while(snd_playing(wh2)) {wait(1);}

Both are I think correct, and if it is a bug can
see many problems!
Posted By: Superku

Re: Possible bug in compare? - 04/02/10 18:10

There is no bug in "compare", I guess it must be a problem with
snd_playing(wh2) != 1 even when the sound is playing. Maybe the function returns some non-zero value, f.i. 3.1415, instead of 1, even though the manual says it should return 1 when the sound is playing.
Posted By: Rei_Ayanami

Re: Possible bug in compare? - 04/02/10 18:14

just, as a workaround, use != 0
Posted By: pegamode

Re: Possible bug in compare? - 04/03/10 06:58

take a look in the manual:

snd_playing

Returns:
0 if a sound with this handle isn't playing, A7.82 otherwise the current play position within the sound buffer in bytes.
© 2024 lite-C Forums