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
Making your own functions
ClayPigeon Offline
Member

Posts: 214
Threads: 13
Joined: Mar 2012
Reputation: 8
#4
RE: Making your own functions

It depends whatever the function should return. (What is the value type)
If the value type is an integer, you'd probably do:
int myfunction(int val, float val2){     return someinteger;}
For a string, float or whatever else:
string myfunction(string &in MyStr){    return somestring;}
float myfloatfunction(float val){    return somefloat;}

However, if the function doesn't reutrn any value, but only does a few operations, you'd use void:
void MyFunction(parameters){    something    something2}

And to use it whenever you need it:
MyFunc(2);
And the function will perform.
06-21-2013, 04:57 PM
Find


Messages In This Thread
Making your own functions - by Theforgot3n1 - 06-21-2013, 03:47 PM
RE: Making your own functions - by lizardrock17 - 06-21-2013, 04:02 PM
RE: Making your own functions - by DeAngelo - 06-21-2013, 04:30 PM
RE: Making your own functions - by richm0nkey - 06-27-2013, 07:28 AM
RE: Making your own functions - by ClayPigeon - 06-21-2013, 04:57 PM
RE: Making your own functions - by Theforgot3n1 - 06-21-2013, 05:08 PM
RE: Making your own functions - by Adrianis - 06-21-2013, 05:43 PM
RE: Making your own functions - by Bridge - 06-21-2013, 05:49 PM
RE: Making your own functions - by Adrianis - 06-21-2013, 06:10 PM
RE: Making your own functions - by Bridge - 06-21-2013, 06:26 PM
RE: Making your own functions - by Adrianis - 06-21-2013, 06:42 PM
RE: Making your own functions - by Bridge - 06-21-2013, 07:26 PM



Users browsing this thread: 2 Guest(s)