3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: Return value  (Read 493 times)

« on: May 04, 2013, 07:35:09 AM »
Hi.

I need more Explanation about Return values. I know how work a Function, but I can't understand what is return values in functions and What used to be? I can't work with this return value in this engine and other engines, Because I can't understand  the concept.

Please Guide Me.

THANKS A LOT
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0

possible way, if we found will make a way.
« Reply #1 on: May 04, 2013, 09:45:43 AM »
Not sure what the exact question is, but here is an example. Just something random put together.

float Doubler(float value)
{
   return value * 2;
}

string RoundDown(float value)
{
   string Text;
   iStringStr(Text,value,"%.2f");
   return Text;
}

void Main()
{
   float Number = 9.99;
   float Something = Doubler(Number);
   
   iPrint("Test: " + RoundDown(Something),0,0,OBJ_0);
}
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #2 on: May 05, 2013, 12:00:53 AM »
Thanks Roberto.

Can you introduce me to a good resource? I can't find any good resource.
I think Need learn it with example.

THANKS
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0

possible way, if we found will make a way.
« Reply #3 on: May 05, 2013, 03:54:06 AM »
What resource are you talking about? Sorry, but I have no idea what you mean.
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #4 on: May 05, 2013, 06:25:20 AM »
First lets understand what a function is, it is a machine which gives you output for a value that you gave as an input. If the value does not lie in the domain of function, the machine will give error. That output value is the return value. Like there is a function like ichartyped and when we press enter as an input it returns -1 as an output. And by using condition like if(ichartyped==-1) do something;
so you applied the concept and created a new system by using the machine(function) ichartyped.
« Reply #5 on: May 05, 2013, 06:41:55 AM »
I mean from resource is good reference that learning Functions complete.
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0

possible way, if we found will make a way.
« Reply #6 on: May 05, 2013, 06:46:03 AM »
I mean from resource is good reference that learning Functions complete.

There is very little to learn about functions. It's the basic AngelScript syntax. It's just the same as a what you would put inside the Main().
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #7 on: May 05, 2013, 06:46:21 AM »
U said concept so i told concept.
Pages: [1]