On Tuesday, Sept 14 1999, Leston Drake wrote:

> Hi all,
> 
> Can anyone help me with playing a MIDI file, using mciSendString() ?
> Here's my script:
>
> on mouseUp
>   local f
>   put "c:/somedir/somefile.mid" into f
>   if there is a file f then
>     get mciSendString("open Sequencer "&f&" alias bgMusic")
>     answer the result
>     # put mciSendString("play bgMusic") into dummy
>     # answer the result
>   else
>     answer "No such file."
>   end if
> end mouseUp
>
> The result of the open command gives:
> "MMSYSTEM259 The command parameter used is not defined in the MCI command set"

There are a couple of problems here.  The first is that the slashes in the
file name need to be reversed.  MetaCard uses the forward slash / on all
platforms as the directory delimiter, but Windows uses \.  So insert a line:

replace "/" with "\" in f

Right before the actual function call.  Second, you want to put quotes
around the file path.  By chance the example you gave would work because
there aren't any spaces in it, but in general it needs quotes because there
could be a space in the path, so try:

get mciSendString("open Sequencer" && quote & f & quote && "alias bgMusic")

Regards,

Kevin

> TIA,
> Leston

Kevin Miller <[EMAIL PROTECTED]> <http://www.xworlds.com/>
Cross Worlds Computing, MetaCard Distributors, Custom Development.
Tel: +44 (0)131 672 2909.  Fax: +44 (0)1639 830 707.

Reply via email to