#define + Strings | Compiler do what it wants ...
#3

Southclaw,
Thank you for your great post!
It helped me a lot!

Quote:
Originally Posted by [HLF]Southclaw
View Post
Okay definitions are EXACT replacements, so to debug one simply put the code in the place of the definition:
Therefore, after the compiler replaces that code you end up with:
pawn Code:
Account[playerid]["Level"] = "47";
The first line is fine, it's the second line that doesn't look like you've anticipated!
I was only concentrated on the first EditAccount-stuff ....
I already got it ... but i didn`t know how to work without the "`s and with the #-character (saw it in pawn-lang.pdf).
I didn`t know what i do.

Its working:
pawn Code:
Acc(Level,"47");

#define Acc(%0,%1);
    EditAccount(playerid, #%0, #%1, 0);
    Account[playerid][%0] = %1;
My "edited" version:
pawn Code:
Acc("Level",47);

#define Acc("%0",%1); \
    EditAccount(playerid,#%0,#%1, 0); \
    Account[playerid][%0] = %1;
There isn`t a big difference, but maybe it helps me (and others) to understand it!


.:: SOLVED ::.


~ Kevin
Reply


Messages In This Thread
#define + Strings | Compiler do what it wants ... [SOLVED] - by Kevin54321 - 11.12.2012, 17:28
AW: #define + Strings | Compiler do what it wants ... - by Kevin54321 - 11.12.2012, 18:55
AW: Re: #define + Strings | Compiler do what it wants ... - by Kevin54321 - 11.12.2012, 19:42

Forum Jump:


Users browsing this thread: 2 Guest(s)