AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   warning 209: function "XX" should return a value (https://forums.alliedmods.net/showthread.php?t=65151)

AlexanderM 01-02-2008 09:50

warning 209: function "XX" should return a value
 
Hi

As wroten at the title, i have this
warning 209: function "XX" should return a value
problem.

Im a litle new scripting plugins to Half Life, and ive had this
problems so meny times ive lost count on it.
Would help a lot if some one could help me, coes this is making
me psycho :evil:

Hope you can help me :)

Alexander

(sorry if some one already have posted how you do this
but i wasen't able to find a post complaning how to do this)

AlexanderM 01-02-2008 13:32

Re: warning 209: function "XX" should return a value
 
Thank you to all, happy for all the help :)
Long time since ive been on a so helpfull forum :):)

AlexanderM 01-02-2008 14:38

Re: warning 209: function "XX" should return a value
 
New prob, new post :-)

http://forums.alliedmods.net/showthr...289#post569289

Emp` 01-02-2008 23:25

Re: warning 209: function "XX" should return a value
 
function "XX" should return a value warning occurs when you return a value during the function, but you then you do not return a value later:

Code:

XX()
{
  if( something )
      return

    do_something()

  return value
}

that is one example that will give this warning. because it returns nothing but then later returns something. you also get the warning if the returns are switched.

*Note that if you do not have a return at the end of a function, then it interprets it as a return nothing.


All times are GMT -4. The time now is 11:10.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.