Author Topic: A Coding Syntax Question On Spaces  (Read 2576 times)

Example from Vehicle_Jeep's "server.cs":

// Vehicle //
/////////////
datablock WheeledVehicleData(JeepVehicle)
{
   category = "Vehicles";
   displayName = " ";
   shapeFile = "./jeep.dts"; //"~/data/shapes/skivehicle.dts"; //
   emap = true;
   minMountDist = 3;
   
   numMountPoints = 7;
   mountThread[0] = "sit";
   mountThread[1] = "sit";
   mountThread[2] = "sit";
   mountThread[3] = "sit";
   mountThread[4] = "sit";
   mountThread[5] = "root";
   mountThread[6] = "root";
   mountThread[7] = "sit";

   maxDamage = 200.00;
   destroyedLevel = 200.00;
   speedDamageScale = 1.04;
   collDamageThresholdVel = 20.0;
   collDamageMultiplier   = 0.02;

--------------------------------------------------------------------------------------------------------------------------------------

Okay, so how do spaces work?  Most of the commands appear to be indented before entered, while some are like three spaces from the left.  Is there a certain way I should enter commands, as in a certain # of spaces?  I'd just like to know how I actually enter stuff like this into notepad.


It's strictly preference in most languages.

For TorqueScript, the standard formatting is Allman style. But it doesn't change how the code is processed because whitespace is ignored.

It's strictly preference in most languages.

For TorqueScript, the standard formatting is Allman style.
there's no "standard formatting"
it doesn't matter at all

there's no "standard formatting"
it doesn't matter at all
i know it doesn't matter, but most people who code in TS use allman. a standard isn't always something necessary.

it doesn't mean anything to a computer, but it means a lot to humans.

Ok thanks!  You guys were helpful!  Locking this topic, since it isn't needed anymore.

Re-unlocking topic due to any further questions ;)

basically indenting makes stuff easier to read and makes it really easy to see where one 'code block' begins and another ends, I would recommend allman but it's personal preference


don't code like marble man you will give coders who later go to read your code cancer

Don't use notepad. Use Notepad++.

Don't use notepad. Use Notepad++.
yes, notepad is very basic and using a text editor that's made for coding is a much better idea

i personally prefer sublime text 2, but afaik there isn't torquescript syntax available for it. C# or C++ works fine though.

sublime text 3 ftw

afaik there isn't torquescript syntax available for it.
yes there is