Default Function Variable?
#1

According to Pawno, functions aren't allowed to have default values.. wtf?

Code:
public iniGetString(filename[], key[], sectioned = 0, section[]
To me, that's really stupid. Anyone know another way of doing this? I want the last 2 parameters to be excludable when calling the function. If "sectioned" is excluded, then it will default to 0... From there I can configure the code to not use sections when searching for ini file values.
Reply
#2

Ah, ok. What's the difference between public and regular functions, anyway?
Reply
#3

Quote:
Originally Posted by Deji
Ah, ok. What's the difference between public and regular functions, anyway?
easy explanation, public is public and every script can use these functions, everything else is only useable for the script, for a better explanation => pawn-lang.pdf/page 83/public
Reply
#4

I can't open PDF files with my current version of Acrobat Reader. And I refuse to use Adobe's new products.
Reply
#5

Quote:
Originally Posted by ♣ Joker ♠
Quote:
Originally Posted by Deji
Ah, ok. What's the difference between public and regular functions, anyway?
easy explanation, public is public and every script can use these functions, everything else is only useable for the script, for a better explanation => pawn-lang.pdf/page 83/public
Hmmm i wouldnt say that. If i remember correctly, public makes a function and/or a variable visable to the sa-mp server itself, and also compiles a different way, (by name instead of address) hence why functions used by timers have to be public / same for callremotefunction.


erm back on topic, just change the public to stock, and all will be well.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)