Posts: 4,885
Threads: 57
Joined: Jun 2012
Reputation:
0
Let me explain again....
Put #define Function at the top of your script
Then denote any functions with that...
Function Test1() {}
Function Test2() {}
Function Test3() {}
Function Test4() {}
Function Test5() {}
It won't do anything but make it easier to search for your function declaration.
Posts: 977
Threads: 10
Joined: Apr 2011
Reputation:
0
Thank you for posting this. It really irks me that people write code when they don't really know what it does.
Posts: 607
Threads: 90
Joined: Feb 2011
Reputation:
0
I'm using stock instead public for a whole time, it's that correct? :/
Posts: 929
Threads: 17
Joined: Mar 2012
Reputation:
0
I use stock but only in one file normally.
The reason is I have a include with many functions i wrote or some from the useful functions thread.
These are functions that may or may not be used in a gamemode.
Now instead of making a new include for each game mode and picking and hunting only the "stock functions"
i need i just include the same one with every mode.(lazy yes i know)
Also when i start a new mode, i may plan to use most/all the functions in the final release however
impossible to use them all right away. As my mode grows the functions are available to me.(I kinda thought this is what stock was for)
I suppose when something becomes a release it would not be a bad idea
to remove the stock modifier from the include and remove unused functions.
anyhow good insights
thanks.
Posts: 60
Threads: 0
Joined: Sep 2015
Reputation:
0
This topic really need an explanation.
#57
Posts: 1,504
Threads: 109
Joined: Jan 2012
So, at the same time there's no disadvantage in using stocks?
(of course, unless you add random stocks to your script that you don't even use)
On the contrary, there is an advantage in using stocks, say you're using the same function on your gamemode like a hundred times, but you want to find the actual function that contains all the code, how do you find it? You can't just do CTRL + F and "MyFunction" because that would give you 100 finds, but if you use stocks, you can easily search "stock MyFunction" and find what you're looking for
Posts: 1,099
Threads: 79
Joined: Nov 2011
Reputation:
0
Another reason why you would use a stock is that you can search for "stock Functionname" if you don't use stock you will need to search for "functionname" which will bring in results that the function itself is used.
A way to counter this is moving all functions to a module / include. But that doesn't help either if you are doing a "search all" at sublime text or anyother text editor though.
Posts: 90
Threads: 10
Joined: Mar 2015
Reputation:
0
So, am I right in thinking.... that Stock is a modifier that hides the function at compile-time if its not used anywhere in the script?
If that's all it does, then why not use it? What's the fuss over not using the stock modifier?