HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Two silly questions

07-17-2009, 10:49 PM#1
Cheezeman
Hey dudes!
So, not wasting a time on a broad intorduction, I here present my questions

1: What's the difference between 'library' and 'library_once'?
2: What's the point of the 'debug' prefix before a call?

Help's appreciated!
07-17-2009, 11:01 PM#2
busterkomo
Quote:
The library_once keyword works exactly like library but you can declare the same library name twice, it would just ignore the second declaration and avoid to add its contents instead of showing a syntax error, it is useful in combination with textmacros.

Quote:
We can now take advantage of this hidden Jass feature. Saving a map in debug mode using JassHelper will simply remove the debug keyword so the calls are enabled, if debug mode is not enabled, JassHelper will remove the lines that begin with debug.

Quotes from JassHelper manual.
07-18-2009, 07:27 AM#3
DioD
Quote:
not wasting a time on a broad intorduction

also no time for manual ,readme, forum FAQ and other threads...
07-18-2009, 11:20 AM#4
Cheezeman
The reason I rather asked in person what they did is that I don't understand the vJass Manual. It's a little too advanced language for me and reading it often results in even more questions.
That 'debug' quote made sence, though I still don't know what library_once does... Can I declare a library with the same name twice, just that one of them won't compile?
07-18-2009, 12:28 PM#5
DioD
if you have problems with english use any translator (promt ex)
07-18-2009, 01:26 PM#6
Blubb-Tec
library_once:
normally, if you declare two libraries that have the same name, you will get a syntax error. however, if you declare a library with library_once instead, the second library will simply be ignored(thats what I understood from "it would just ignore the second declaration and avoid to add its contents instead of showing a syntax error")
07-18-2009, 02:06 PM#7
Cheezeman
Makes sence, but how is that useful? Why not just replace the former library, or rename it?
There was something about textmacros, but I havn't found their purpose useful enough to start learning them, yet.
What you said was basically what I thought, just that I wanted some kind of confirmation, cause - in my mind - they don't make much sence.

Any concrete example of its use? I noticed it in the TimerUtils library, but it might aswell use library instead.
07-18-2009, 04:21 PM#8
Sophismata
I'm not sure why TimerUtils uses it, either.