How to ignore an argument?
#1

How to ignore an argument which has no predefined value?
Reply
#2

Do you mean this:
pawn Код:
#pragma unused argument
(?)
Reply
#3

Quote:
Originally Posted by YJIET
Посмотреть сообщение
Do you mean this:
pawn Код:
#pragma unused argument
(?)
That wouldnt work as it would ignore a variable named "argument"
Reply
#4

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;
}
Reply
#5

Quote:
Originally Posted by YJIET
Посмотреть сообщение
Uhm.. you can also ignore arguments:
pawn Код:
Function(arg)
{
    #pragma unused arg
    return 1;
}
Not that.
Reply
#6

I don't understand why ignore an argument if it doesn't have a predefined value.
Couldn't you have "stock Function(arg = 0)"?
Reply
#7

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.
Reply
#8

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 ) {...}
Reply
#9

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)