Jump to content


Photo

Bug in MCI_command?


  • Please log in to reply
4 replies to this topic

#1 Plastic

Plastic

    GMC Member

  • New Member
  • 28 posts
  • Version:GM7

Posted 18 February 2012 - 03:10 PM

Hi,
I found a weird bug in the MCI_command() function.
It works when I use this:
{
  MCI_command(' open "applause.wav" alias "applause" ');
  MCI_command(' play "applause" ');
}

But it doesn't work when I try this:
{
  MCI_command(" open 'applause.wav' alias 'applause' ");
  MCI_command(" play 'applause' ");
}

Why does my code work when I use singular quotes, and why doesn't my code work when I use double quotes?
Is this a bug?
I'm using :GM7: , so I don't know if it has been fixed in newer versions.
I would like to hear why my second code doesn't work.

Edit: Problem solved. The reason why my second code didn't work was because single and double quotes can't be interchanged in the MCI command.

Edited by Plastic, 16 April 2012 - 03:11 PM.

  • 0

#2 Plastic

Plastic

    GMC Member

  • New Member
  • 28 posts
  • Version:GM7

Posted 15 April 2012 - 05:57 PM

I would like to know why my code doesn't work. My problem is still unsolved.
  • 0

#3 JacksonYarr

JacksonYarr

    GMC Member

  • GMC Member
  • 248 posts
  • Version:GM:Studio

Posted 16 April 2012 - 06:00 AM

Greetings,

Since MCI commands are handled by Windows and not GameMaker, single and double quotes are not interchangeable. Whilst GameMaker isn't strict on their usage, certain languages are. Often double quotes are used to represent a string, and single quotes to represent a single character (The char variable type).

It certainly isn't a bug though, you just need to remember not to use single quotes in any arguments being passed to a Windows command.

Hope this helps,
JacksonYarr
  • 1

#4 Plastic

Plastic

    GMC Member

  • New Member
  • 28 posts
  • Version:GM7

Posted 16 April 2012 - 03:07 PM

Greetings,

Since MCI commands are handled by Windows and not GameMaker, single and double quotes are not interchangeable. Whilst GameMaker isn't strict on their usage, certain languages are. Often double quotes are used to represent a string, and single quotes to represent a single character (The char variable type).

It certainly isn't a bug though, you just need to remember not to use single quotes in any arguments being passed to a Windows command.

Hope this helps,
JacksonYarr

Thanks for the reply!
I thought one could use both single and double quotes in GameMaker.
That solves my problem.
  • 0

#5 Desert Dog

Desert Dog

    GMC Member

  • GMC Member
  • 6409 posts
  • Version:Unknown

Posted 16 April 2012 - 10:18 PM

Sweet, that's good to know. Cheers, JacksonYarr!
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users