Frictional Games Forum (read-only)

Full Version: Creating new parameters question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I was learning about creating new functions in the wiki article. Now I was reading about it and I just made a function line like this.
Code:
int FUNCTION(sig 1, sig 2, and so on)
{
}

Like so right? But, how do I know that the new parameter will do exactly what I said, I mean what happens if something's wrong? Is it tested that it'll do exactly what I describe?

NOTE: I haven't test it, in fact I just found them today.
The parser (or compiler) will exit with an error if the function is improperly formed or does not exist when called.
^ this, but also...
Quote: how do I know that the new parameter will do exactly what I said
The parameter will do what you tell it to do in the logic of the function. Parameters are simply variables of a given type that you provide to the function when you call it, they don't 'do' anything in-and-of themselves
Quote: Is it tested that it'll do exactly what I describe?
You haven't 'described' anything for it to do. When you write some code in the function, you should have a good idea of how to test if it's working