Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
returning values (return command)
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#2
RE: returning values (return command)

In that case, return is used to prevent the code from reading the rest of the code. It stops and continues at the parent function that called it.

If you had your function declared as string or whatever instead of void, you could return data of that type by using return value


PHP Code: (Select All)
string Message () 
{    
     return 
"hello";




At least that's how I use it and works as expected.
No idea if here has another use other than that.

01-02-2014, 09:36 PM
Find


Messages In This Thread
returning values (return command) - by RaideX - 01-02-2014, 07:35 PM
RE: returning values (return command) - by Daemian - 01-02-2014, 09:36 PM
RE: returning values (return command) - by RaideX - 01-02-2014, 09:56 PM
RE: returning values (return command) - by Javist - 01-03-2014, 09:34 AM



Users browsing this thread: 1 Guest(s)