Why can't use . in macro and what means . in PAWN
#1

As in title
pawn Код:
#define X:%0.%1(%2) something
why it gives an error that it found . (dot) ?

And . (dot) in PAWN means only float value or something else?
Reply
#2

Here's an example of another use for dot. You can use it in functions to specify a parameter in a function call.

pawn Код:
public OnFilterScriptExit()
{
    foo( .arg3 = 1, .arg2 = 2, .arg1 = 3, .arg0 = 4 );//not called in order of function definition
    return 1;
}

foo(arg0=0, arg1=0, arg2=0, arg3=0)
{
    printf( "%d %d %d %d", arg0, arg1, arg2, arg3);//should print 4 3 2 1
}
Though i don't know if that's your problem, because i don't know what your trying to do with the code you posted.

EDIT: It looks like a strange macro (syntax at least) this would work with it now. (no errors i mean)

pawn Код:
#define X:%0.%1(%2) 1

new i = X:a.a(5);
//or even
new i = X:^.^(666);
The problem is probably in the code that follows the macro header.
Reply
#3

Lol, i try it again and works, don't know why the last time they give me strange error :P

thanks anyway

But new question

pawn Код:
#define X:%0.%1(%2) %1(%0,%2)
#define X:%0.some() somethingelse(%0)
and this gives me error
Quote:

: warning 201: redefinition of constant/macro (symbol "X:%0.some()")

some clever ideas on how to do it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)