AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Function order in my source code? How should it be? (https://forums.alliedmods.net/showthread.php?t=28771)

Geesu 05-22-2006 09:48

Function order in my source code? How should it be?
 
Basically as the title says... Does the compiler build a list of all the functions before it checks for "function not found" or "function not implemented" errors?

I'm thinking it doesn't.. so how can I sidestep this? I thought "ok lets make header files", which I did, but not all my functions are public, how should i define them if they're not public?

Or is it possible to compile the plugin so it builds a list of the available functions before it actually compiles the files?

Hawk552 05-22-2006 09:55

I don't think it does. When you include a header file though everything in it is put into the plugin, with the exception of stocks. If a stock is called somewhere in the plugin, then it is included, otherwise it is not.

From what I can tell, when the compiler sees a function, it'll basically seek through the script until it sees a definition for it. I'm not quite sure, but that's based on the fact that if you add an extra opening bracket anywhere, functions after that appear as undefined.

Greenberet 05-22-2006 11:40

the compiler creates a list of all funcions ( except native ). I think thats called double parsing or something like that.
So you can call each function from everywhere.

Geesu 05-22-2006 13:26

k thanks


All times are GMT -4. The time now is 16:19.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.