Raised This Month: $ Target: $400
 0% 

loose indentation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
geertjan88
Member
Join Date: May 2006
Old 12-22-2006 , 17:27   loose indentation
Reply With Quote #1

I get a lot of loose indentation errors and i want to remove them couse after a compile it is really hard to see how it went i just want 0 warnings and 0 errors.
For example this gives an warning loose indentation:

Code:
public leet_control_laptop(id,key)
{	
	switch(key)
	{
		case 0:
		{
			pdbackdoorA(id)
			leet_control_laptop_show(id)
		}
		case 1:
		{
			pdjaildoorA(id)
			leet_control_laptop_show(id)
		}
		case 2:
		{
			jaildoor1A(id)
			leet_control_laptop_show(id)
		}
		case 3:
		{
			jaildoor2A(id)
			leet_control_laptop_show(id)
		}
		case 4:
		{
			jaildoor3A(id)
			leet_control_laptop_show(id)
		}
	}
return PLUGIN_HANDLED
}
The compiler says it is in the rule where "return PLUGIN_HANDLED" is.
__________________
if i help? +karma!
geertjan88 is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 12-22-2006 , 17:37   Re: loose indentation
Reply With Quote #2

loose indentation is just a warning (and does not affect the code). all it really wants is that you line up your lines. your return line should have the same amount of tabs/spaces as the bracket before it.

AMXX studio has a command to do this for you.

edit:

so instead of code looking like this
Code:
	public zomg2_checker()
{
if(blah_blah)
{
	happy = true
		zomg = false
}
	if(zomg)
zomg2 = true
}
it should be
Code:
public zomg2_checker()
{
	if(blah_blah)
	{
		happy = true
		zomg = false
	}
	if(zomg)
		zomg2 = true
}

Last edited by Emp`; 12-22-2006 at 17:40.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
geertjan88
Member
Join Date: May 2006
Old 12-22-2006 , 17:40   Re: loose indentation
Reply With Quote #3

Well thanks. But what is the command and what for example wrong in the code i posted?
__________________
if i help? +karma!
geertjan88 is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 12-22-2006 , 17:44   Re: loose indentation
Reply With Quote #4

[img]http://img321.**************/img321/5862/indenttoolvn9.jpg[/img]

and as i previously stated, your return line should have as many spaces/tabs as the line before it:
Code:
public leet_control_laptop(id,key)
{	
	switch(key)
	{
		case 0:
		{
			pdbackdoorA(id)
			leet_control_laptop_show(id)
		}
		case 1:
		{
			pdjaildoorA(id)
			leet_control_laptop_show(id)
		}
		case 2:
		{
			jaildoor1A(id)
			leet_control_laptop_show(id)
		}
		case 3:
		{
			jaildoor2A(id)
			leet_control_laptop_show(id)
		}
		case 4:
		{
			jaildoor3A(id)
			leet_control_laptop_show(id)
		}
	}
	return PLUGIN_HANDLED
}
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
geertjan88
Member
Join Date: May 2006
Old 12-22-2006 , 17:58   Re: loose indentation
Reply With Quote #5

sorry i am not english i don't understand "and as i previously stated, your return line should have as many spaces/tabs as the line before it"
__________________
if i help? +karma!
geertjan88 is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 12-22-2006 , 18:58   Re: loose indentation
Reply With Quote #6

This character: {

and

This character: }

should be the same amount of spaces from the left side of the page.


IN DUTCH:

Dit teken: {

En

Dit teken: }

Zou de zelfde hoeveelheid van ruimtes van de linkerzijde van de pagina moeten zijn.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Throstur
Senior Member
Join Date: Nov 2004
Location: Iceland
Old 12-22-2006 , 20:48   Re: loose indentation
Reply With Quote #7

Sweet, gotta get amxx studio, been using crimson (the best imo anyways, but still, nice to have amxx files)
__________________
Throstur is offline
Send a message via AIM to Throstur Send a message via MSN to Throstur
Simon Logic
Senior Member
Join Date: Nov 2006
Location: RF
Old 12-23-2006 , 15:53   Re: loose indentation
Reply With Quote #8

I love #pragma tabsize N
=)
Simon Logic is offline
Send a message via Skype™ to Simon Logic
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 22:30.


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