How to ignore an argument? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to ignore an argument? (
/showthread.php?tid=325689)
How to ignore an argument? - T0pAz - 14.03.2012
How to ignore an argument which has no predefined value?
Re: How to ignore an argument? -
Stylock - 14.03.2012
Do you mean this:
(?)
Respuesta: Re: How to ignore an argument? -
kirk - 14.03.2012
Quote:
Originally Posted by YJIET
|
That wouldnt work as it would ignore a variable named "argument"
Re: Respuesta: Re: How to ignore an argument? -
Stylock - 14.03.2012
Quote:
Originally Posted by kirk
That wouldnt work as it would ignore a variable named "argument"
|
Uhm.. you can also ignore arguments:
pawn Код:
Function(arg)
{
#pragma unused arg
return 1;
}
Re: Respuesta: Re: How to ignore an argument? - T0pAz - 15.03.2012
Quote:
Originally Posted by YJIET
Uhm.. you can also ignore arguments:
pawn Код:
Function(arg) { #pragma unused arg return 1; }
|
Not that.
Re: How to ignore an argument? -
SimonItaly - 15.03.2012
I don't understand why ignore an argument if it doesn't have a predefined value.
Couldn't you have "stock Function(arg = 0)"?
Re: How to ignore an argument? - T0pAz - 15.03.2012
Quote:
Originally Posted by DarkSlyder
I don't understand why ignore an argument if it doesn't have a predefined value.
Couldn't you have "stock Function(arg = 0)"?
|
No, I want to achieve something else.
Re: How to ignore an argument? -
iPLEOMAX - 15.03.2012
You want to solve "function argument may not have a default value (variable X)"
Yes?
If that, just create a stock,
pawn Код:
stock ABC( somevar = 5 ) {...}
then
pawn Код:
public ABC_pub( somevar ) {...}
Re: How to ignore an argument? - T0pAz - 15.03.2012
Quote:
Originally Posted by iPLEOMAX
You want to solve "function argument may not have a default value (variable X)"
Yes?
If that, just create a stock,
pawn Код:
stock ABC( somevar = 5 ) {...}
then
pawn Код:
public ABC_pub( somevar ) {...}
|
But reference cannot have a predefined value. I am really puzzled.