(Somewhat) Advanced Scripting Question
#1

I'm reading pawn_lang and I'm currently learning about constants (and other types of data declarations). It says that a constant can be used when you want a variable that should only be set by the "host application". What would be the "host application" in terms of scripting for SA-MP? When should I use a constant in the case of SA-MP?
Reply
#2

http://dictionary.reference.com/browse/constant?s=t

Quote:

not changing or varying;

You would use const when you know something isn't going to be changing at all.
Reply
#3

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
http://dictionary.reference.com/browse/constant?s=t



You would use const when you know something isn't going to be changing at all.
I've gotten that much of course, but I'm more focused on what can change a constant. pawn_lang states that the host application can change it - so what would the host application be in terms of scripting for SA-MP (if there is one)?
Reply
#4

Constants can't be modified once set. In a way they simply act like a macro. But you can also make a constant array of coordinates which can then be compiled a bit more efficiently.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)