[futurebasic] Re: Conflict with RAM Doubler

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 1998 : Group Archive : Group : All Groups

From: Chris Stasny <staz@...>
Date: Tue, 2 Jun 1998 15:03:06 -0500
>>I've written a pretty vanilla FBII program.  It's been running perfectly
>>on a variety of systems and configurations.  I just ran it on a machine
>>using RAM Doubler and it didn't work.  Disabling RAM Doubler and it worked.
>>In particular, it didn't play a 'snd ' resource from an external file.
>>The code leading up to it, freely plagarized from the Handbook and
>>Turovich, is:
>>LOCAL FN PlaySound
>>oldresrefnum% = FN CURRESFILE
>>srcresrefnum% = USR OPENRFPERM("extfile.rsc",SYSTEM(_aolVol),_fsRdPerm)
>>LONG IF srcresrefnum% <> 0
>>     snd& = FN GETRESOURCE (_"snd ",resourceid%)
>>     LONG IF ((FN RESERROR = _noErr) AND (snd& <>0))
>>          DEFSTR LONG
>>          snd$ = "&"+MKI$(snd&)
>>          SOUND snd$
>>          END IF
>>     END IF
>>CALL CLOSERESFILE(srcresrefnum%)
>>CALL USERESFILE(oldresrefnum)

some other items that I overlooked...

LONG IF srcresrefnum% <> 0

should be

LONG IF srcresrefnum% > 0     :REM (-1, -192, etc. are possible error codes)

You can skip _all_ of your CURRESFILE, USERESFILE stuff. The file is made
current when it is open and dropped to the previous top when it is closed.

There is no advantage at all to setting a specific USERESFILE with
GETRESOURCE. GET1RESOURCE uses a specific file, all others use almost
anything that is open.

Your sound call conversion stuff is not necessary. Use... "SOUND %resourceid%".

Don't worry.  Be happy.

-STAZ   ')'

STAZ Software * 4387 Leisure Time Dr * Diamondhead, MS 39525
Orders: 800-348-2623      EMail http: //www.stazsoftware.com
  Tech: 228-255-7085       Happy FAX: 228-255-7086