[futurebasic] Re: [FB] locking resource handles

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 1999 : Group Archive : Group : All Groups

From: Rick Brown <rbrown@...>
Date: Sat, 01 May 1999 11:35:44 -0500
Lucy wrote:

> >Now, I know _something_ isn't right, because now and then the code will lose
> >its grip on the sound I want, and instead play a _different_ sound that was
> >loaded subsequently into a _different_ handle.

Let me see if I understand right.  Are you saying you're doing something like
this?

gameSound& = FN LoadNamedSound("snork")
     :
gOtherSound& = FN LoadNamedSound("dwibble")
     :
DEFSTR LONG
s$ = "&" + MKI$(gameSound&)
SOUND s$

...and you're expecting to hear "snork", but instead you hear "dwibble"?  I can
see how this could happen if you're loading all of your sounds into the
gameSound& variable.  But your message seems to indicate that you're not doing
that.

Also, note that you must redefine the "s$" string _every_ time just before you
call SOUND.  For example:

DEFSTR LONG
    :
gameSound& = FN LoadNamedSound("snork")
s$ = "&" + MKI$(gameSound&)
SOUND s$  'This plays "snork"
    :
gameSound& = FN LoadNamedSound("dwibble")
'(Failed to re-assign s$ here)
SOUND s$  'Might play "dwibble", or "snork", or...?

Any of this look similar to what you're doing?

- Rick