Problem function<--RESOLVED-->Tnk-->Skydereign

Non-platform specific questions.

Problem function<--RESOLVED-->Tnk-->Skydereign

Postby equinox » Sat Apr 04, 2009 12:37 pm

HI at ALL,

I do not understand how to fix it. Any ideas?

Tnk1000.
Attachments
Image1.png
Last edited by equinox on Sat Apr 04, 2009 5:05 pm, edited 1 time in total.
User avatar
equinox
 
Posts: 118
Joined: Tue Jan 29, 2008 3:38 pm
Score: 0 Give a positive score

Re: Problem function

Postby Bee-Ant » Sat Apr 04, 2009 1:40 pm

What if this...
Code: Select all
void CALC(int p)
{
   if(strcmp(NONE[NP],"Leone")==0)
   {
      switch(p)
      {
         case 0;
         return 10;
         break;
      }
   }
}
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Problem function

Postby skydereign » Sat Apr 04, 2009 4:31 pm

No, the error is caused by your use return. Return automatically exits the code, so you don't need to use break. Typically people will still use a break, and have the return at the end of the function call. If you fix that, it should work.
http://game-editor.com/forum/viewtopic.php?f=5&t=6542
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Problem function

Postby equinox » Sat Apr 04, 2009 5:04 pm

Perfect !!!

Tnk1000 for help me.
User avatar
equinox
 
Posts: 118
Joined: Tue Jan 29, 2008 3:38 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron