Raised This Month: $ Target: $400
 0% 

Loose Indentation Error...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hazukiy
Member
Join Date: Jul 2009
Location: England
Old 03-04-2013 , 10:37   Loose Indentation Error...
Reply With Quote #1

Hi, I'm making a mod and I'm just cleaning up the code now, but I can't seem to figure out this error, here's the code that's giving me the error.

PHP Code:

   
for(new 0<= 20= (4)) 
Something on that line is making it give me a "Loose Indentation Error". Help would be appreciated, thanks.
hazukiy is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 03-04-2013 , 10:50   Re: Loose Indentation Error...
Reply With Quote #2

Loose indentation means you're fluctuating between multiple indent (the space before each line) styles.
Code:
Things();
    Stuff();
That, basically. Things didn't make a new "block" for Stuff, so the indentation's loose; it changed for no reason. You can have any style of indentation you want (I'm pretty sure) but you have to stick with one in a block, else you get warnings like the one you're getting.

This all said, you didn't post any other line of your code, so we don't know what's different between the two; although if I had to guess, since that line has three spaces in front of it, either adding another space or replacing those three spaces with a tab might fix it.

If you're getting many of these (example: copying code from this forum uses spaces for indenting), Notepad++ has a feature to fix it for you: Menu bar -> TextFX -> TextFX Edit -> Reindent C++ code. All of the warnings will go away like magic.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)

Last edited by MasterOfTheXP; 03-04-2013 at 10:52.
MasterOfTheXP is offline
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Lithuania
Old 03-05-2013 , 12:09   Re: Loose Indentation Error...
Reply With Quote #3

Paste this at 1 line:

#pragma tabsize 0
iGANGNAM is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 03-05-2013 , 14:56   Re: Loose Indentation Error...
Reply With Quote #4

Quote:
Originally Posted by iGANGNAM View Post
Paste this at 1 line:

#pragma tabsize 0
I wouldn't recommend this. Just indent correctly.
__________________
11530 is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 03-05-2013 , 15:43   Re: Loose Indentation Error...
Reply With Quote #5

Also can be a problem when you're using spaces or tabs, and then start using the opposite.
bl4nk is offline
ajr1234
Senior Member
Join Date: Mar 2011
Location: Chicago, IL, U.S.A.
Old 03-05-2013 , 16:09   Re: Loose Indentation Error...
Reply With Quote #6

Out of curiosity, can indentation warnings be detrimental if left unfixed?
ajr1234 is offline
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 03-06-2013 , 01:42   Re: Loose Indentation Error...
Reply With Quote #7

I don't thinks so if you use ";" as terminator. If you don't I'm not 100% sure if it could cause a problem.
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de
Sillium is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 03-06-2013 , 09:27   Loose Indentation Error...
Reply With Quote #8

Quote:
Originally Posted by ajr1234 View Post
Out of curiosity, can indentation warnings be detrimental if left unfixed?
Your plugin won't be approved if it has compilation warnings.
__________________
Dr. McKay is offline
ajr1234
Senior Member
Join Date: Mar 2011
Location: Chicago, IL, U.S.A.
Old 03-06-2013 , 11:23   Re: Loose Indentation Error...
Reply With Quote #9

Quote:
Originally Posted by Dr. McKay View Post
Your plugin won't be approved if it has compilation warnings.
Does it affect the plugin adversely though?
ajr1234 is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 03-06-2013 , 11:31   Loose Indentation Error...
Reply With Quote #10

Quote:
Originally Posted by ajr1234 View Post
Does it affect the plugin adversely though?
No.
__________________
Dr. McKay is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode