Raised This Month: $ Target: $400
 0% 

Function order in my source code? How should it be?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 05-22-2006 , 09:48   Function order in my source code? How should it be?
Reply With Quote #1

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?
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-22-2006 , 09:55  
Reply With Quote #2

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.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 05-22-2006 , 11:40  
Reply With Quote #3

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.
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 05-22-2006 , 13:26  
Reply With Quote #4

k thanks
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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