contents   index   previous   next

White space characters


White space characters, space, tab, carriage-return and new-line, govern the spacing and placement of text. White space makes code more readable for humans, but is ignored by the interpreter.


Lines of script end with a carriage-return, and each line is usually a separate statement. (Technically, in many editors, lines end with a carriage-return and linefeed pair, "\r\n".) Since the interpreter usually sees one or more white space characters between identifiers as simply white space, the following ScriptEase statements are equivalent to each other:


var x=a+b

var x = a + b

var x =          a         +          b

var x = a

          + b


White space separates identifiers into separate entities. For example, "ab" is one variable name, and "a b" is two. Thus, the fragment, var ab = 2 is valid, but var a b = 2 is not.


Many programmers use all spaces and no tabs, because tab size settings vary from editor to editor and programmer to programmer. By using spaces only, the format of a script will look the same on all editors. All scripts provided by Nombas with ScriptEase use spaces only.