29.09.2010, 14:23
Ok, so I've got this code:
Now if I want to use this code in my scripts, it gives me the following error:
I'm kinda sick of finding out WHAT exactly causes the compiler to get this error, I've already tried quite everything I could come up with. That includes in placing the code in "how the compiler thinks it is".
For those interested:
Any help is welcome ^^.
PS: I'm also getting some sort of problem with 'sizeof' when not giving the string/array a fixed length like:
Any tips on that would be great as well ^^
pawn Код:
#define CreateLetter(%0) \
for(new letter; letter < sizeof (%0); letter++) \
{ \
CreateObject(FONT, x + (%0)[letter][0] + (spacing * 4.8), y, z + (%0)[letter][1], 0, 0, 0); \
} \
spacing++ //There is NO ';' supposed to be here
Код:
C:\Users\Hiddos\Hiddos\scripts\filterscripts\haystacks.pwn(490) : warning 217: loose indentation
For those interested:
pawn Код:
public CreateHayText(sentence[32], Float:x, Float:y, Float:z)
{
new spacing = 0;
for(new lpos; lpos < sizeof sentence; lpos++)
{
switch(lpos)
{
case 'a', 'A':
{
CreateLetter(A); //Loose indentation
}
case 'b', 'B':
{
//CreateLetter(B);
for(new letter; letter < sizeof A; letter++)
{
CreateObject(FONT, x + B[letter][0] + (spacing * 4.8), y, z + B[letter][1], 0, 0, 0);
}
spacing++;
//Would be EXACTLY the same code as generated, but NO loose indentation.
}
//All cases with 'case 'c', 'C': {}', doesn't relates to the problem at all.
default: spacing += 2;
}
}
return 1;
}
PS: I'm also getting some sort of problem with 'sizeof' when not giving the string/array a fixed length like:
pawn Код:
stock bla(text[])
{
new var = sizeof text; //Errors
}
stock bla(text[128])
{
new var = sizeof text; //Does not errors;
}