Loose indentation - Am I an idiot or...?
#1

Ok, so I've got this code:

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
Now if I want to use this code in my scripts, it gives me the following error:

Код:
C:\Users\Hiddos\Hiddos\scripts\filterscripts\haystacks.pwn(490) : warning 217: loose indentation
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:

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;
}
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:

pawn Код:
stock bla(text[])
{
  new var = sizeof text; //Errors
}

stock bla(text[128])
{
  new var = sizeof text; //Does not errors;
}
Any tips on that would be great as well ^^
Reply


Messages In This Thread
Loose indentation - Am I an idiot or...? - by Hiddos - 29.09.2010, 14:23
Re: Loose indentation - Am I an idiot or...? - by Finn - 29.09.2010, 14:40
Re: Loose indentation - Am I an idiot or...? - by samgreen - 29.09.2010, 14:50
Re: Loose indentation - Am I an idiot or...? - by Hiddos - 29.09.2010, 15:58
Re: Loose indentation - Am I an idiot or...? - by VIRUXE - 29.09.2010, 16:16
Re: Loose indentation - Am I an idiot or...? - by Hiddos - 29.09.2010, 18:01

Forum Jump:


Users browsing this thread: 1 Guest(s)