Stupid Question about indention

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
junoslord
Posts: 82
Joined: June 11th, 2012, 3:13 pm
Location: Enveloping your left flank.

Stupid Question about indention

Post by junoslord »

How important is it?

I kind of know because some parts of my last scenario didn't work until I fixed it... I noticed that the odd number columns seem to be where it's at, but if I use regular tab indents will they work? Is it important that they are aligned, not in which column they're located?
America-- Land of the Free, home of the Brave! "And now that we've taken care of the Braves we're coming after the Free."

"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"

Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: Stupid Question about indention

Post by Ceres »

Indentation is purely for readability and should never cause any problems. I always use tab indent and it always worked. If there are any problems, the error lies probably somewhere else (like linebreaks).

User avatar
battlestar
Posts: 690
Joined: January 1st, 2007, 7:12 am

Re: Stupid Question about indention

Post by battlestar »

Readability is for when you run into an error and have to go through the code, and when you show other ppl your code for the purpose asking questions and teamwork projects. It's pretty important, like having the right punctuation and paragraph breaks in writing essays.
LUA: Llama Under Apprenticeship
Hell faction: completed

User avatar
Simons Mith
Posts: 784
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: Stupid Question about indention

Post by Simons Mith »

"If you don't know what you're doing, do it neatly."
 

User avatar
lipk
Developer
Posts: 637
Joined: July 18th, 2011, 1:42 pm

Re: Stupid Question about indention

Post by lipk »

Consistent indentation helps avoiding errors, too.

Code: Select all

[event]
[filter]
side=1
[not]
[filter_location]
x,y=20
radius=3
terrain=!,*^V*
[/filter_location]
[/filter]

[message]
speaker=narrator
message=_ "Consistent indentation helps avoiding errors, too"
[/message]
[/event]

Code: Select all

[event]
  [filter]
    side=1
    [not]
      [filter_location]
        x,y=20
        radius=3
        terrain=!,*^V*
      [/filter_location]
    [/filter]

    [message]
      speaker=narrator
      message=_ "Consistent indentation helps avoiding errors, too"
    [/message]
  [/event]
# Oh wait! The indentation level of [/event] doesn't match that of [event]? Something must have gone wrong here!

User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: Stupid Question about indention

Post by Sapient »

Good example... /not !
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."

Post Reply