PAWN Error/Warning codes
#6

Warning 217 - loose indentation:

Caused by bad indentation.

Example:

pawn Код:
if( strcmp( cmdtext, "/test", true ))
                {
      MyFunctionHere;
 if( something == somethingElse )
      {      somethingMuchElse; }
                            return true;
                  }
How to fix: Indent.

Indentation is tabs in script.
First code starts at column 0 (or 1) which is 0 tabs.
If a sub-part of a code (after a opening bracket { or if statement generally) you put a tab.

Example how to fix:
pawn Код:
if( strcmp( cmdtext, "/test", true ))
{   //first part of code, no tabs
    MyFunctionHere; //pawn uses 4 spaces for one tab. This is after a opening bracket, therefore we enter one tab.
    if( something == somethingElse ) //here is another statement, but followed by a bracket, so the bracket won't be indented.
    {      
        somethingMuchElse; //this, on the other hand, is after a bracket, therefore we indent with another tab.
    } //the bracket is closed, therefore we go back to the column where the bracket is positioned (indented).
    return true; //still the same column, since there are no more opening-brackets, and no statements.
} //closing this part of code - go back to the first column
Reply


Messages In This Thread
PAWN Error/Warning codes - by DVDK - 24.10.2010, 15:11
Re: PAWN Error/Warning codes - by ••• ĤБĶБM ••• - 24.10.2010, 15:17
Re: PAWN Error/Warning codes - by DarrenReeder - 24.10.2010, 15:26
Re: PAWN Error/Warning codes - by iJumbo - 24.10.2010, 15:40
Re: PAWN Error/Warning codes - by DVDK - 25.10.2010, 10:44
Re: PAWN Error/Warning codes - by LarzI - 25.10.2010, 11:55
Re: PAWN Error/Warning codes - by DVDK - 25.10.2010, 12:08
Re: PAWN Error/Warning codes - by LarzI - 25.10.2010, 12:31
Re: PAWN Error/Warning codes - by DVDK - 25.10.2010, 22:09
Re: PAWN Error/Warning codes - by randomkid88 - 26.10.2010, 01:54
Re: PAWN Error/Warning codes - by Luis- - 26.10.2010, 02:05
Re: PAWN Error/Warning codes - by Scenario - 26.10.2010, 02:16
Re: PAWN Error/Warning codes - by DVDK - 28.10.2010, 17:09
Re: PAWN Error/Warning codes - by DVDK - 02.12.2010, 21:18
Re: PAWN Error/Warning codes - by alexandrusava93 - 24.09.2012, 20:32
Re: PAWN Error/Warning codes - by stefanescu - 05.01.2013, 15:46
Re: PAWN Error/Warning codes - by Affan - 05.01.2013, 17:26
Re: PAWN Error/Warning codes - by marcos19952 - 07.01.2013, 15:38
Re: PAWN Error/Warning codes - by Onepind - 05.09.2014, 23:28
Re: PAWN Error/Warning codes - by krstecd - 13.10.2014, 16:42

Forum Jump:


Users browsing this thread: 3 Guest(s)