Declaring functions

Started by MachineElf, Wed 16/07/2003 15:23:44

Previous topic - Next topic

MachineElf

It's possible to import functions to room scripts, but is it also possible to declare a function in the top of my global script so I don't have to care about the order I write the functions?

example:
// top of script:
function addition (int,int);

//further down:
function addition (int para1, int para2)
{
return para1+para2
}

This would sometimes be pretty helpful...
There are 10 kinds of people in the world: Those who understand binary and those who don't.

TerranRich

No, you'd have to import it in the script header, ,then declare it normally in the global script. I don't think there's any other way...or is there? :)
Status: Trying to come up with some ideas...

Pumaman

Forward references are not currently supported due to the way the compiler works. You can declare it in the script header, but it won't let you use it before it's defined in the global script.

MachineElf

Ok, thanks!
Any chance that will change in the future?
Not a big thing, really, but it could help a little...
There are 10 kinds of people in the world: Those who understand binary and those who don't.

SMF spam blocked by CleanTalk