[ANY] '#file' and what it does
I just discovered this for the first time in use in a plugin by JugadorXEI, where he had the following bit of code under his #pragma lines:
#file "Rebalanced Fortress 2" Initially I was confused as to what #file did, until I tried compiling the plugin. Normally, without the use of #file "nameofplugin", the compile.exe window will print out something similar to the following for errors/warnings: C:\Coding\scripting\exampleplugin.sp(1) : warning 219: etcetera. With the addition of #file "nameofplugin" to your plugin, compiling it with compile.exe will show the following for errors/warnings instead: nameofplugin(1): warning 219: etcetera Here's an image showing the difference in output: https://cdn.discordapp.com/attachmen...65/unknown.png I don't know if #file does anything else aside from this. Please, do tell if it does. As well, in regards to directives that I don't know the functionality of, there's also #assert, #emit and #error. Don't know what they do. |
Re: [ANY] '#file' and what it does
oh lord this makes me nut so hard. Error logs have always bugged me for how messy they are and this helps that a lot.
|
Re: [ANY] '#file' and what it does
I've always hated the full path being part of the error messages. Why has this been hush hush for so long?
|
Re: [ANY] '#file' and what it does
Quote:
|
Re: [ANY] '#file' and what it does
What happens when you have
'#file "etc"' within a file that you're including? |
Re: [ANY] '#file' and what it does
Quote:
|
Re: [ANY] '#file' and what it does
Personally, I like default behaviour, because you can see there a version number of your plugin (if you care about beautiful and correct folder structure of your plugins, of course).
Otherwise, it's impossible due to the fact dev. team refused request about adding version number to debug log. Sometimes it's become very useful kind of info. Also, you can indirectly see the person, who compiled the plugin (if you have several admins who care about plugins update). BTW, 404UNF, thanks for info. |
Re: [ANY] '#file' and what it does
Quote:
As for the full path, its just easier to read. Imagne having alot of servers with alot of different plugins. If the stack trace only printed filenames you will have a hard time, especially includes. Also its usefull for automated tools. Missusing #file/#line may cause confusion and generates unreadable stack traces. For example if the user renames the source file. It should never be used manualy, there is no reason why you should realy. Quote:
|
Re: [ANY] '#file' and what it does
Quote:
Quote:
|
Re: [ANY] '#file' and what it does
Quote:
I also just asked in the SourceMod Discord what all #file does, and all it does is change what's shown in compile.exe, so me using it in some recent plugins and putting it into the updated SPEdit templates as part of my PR on JulienKluge's repo is all good. You had me worried for a second there when I read your post, Timo :P |
All times are GMT -4. The time now is 07:24. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.