Just a note (and a lot of scripters don't do this, at all, but I think it looks messy, otherwise), if you put all of your opening brackets in their own line like so:
ffc script example
{
void run(x,y)
{
while (true)
{
//code here
}
}
}
it makes it a lot easier to keep track of your closing brackets and to make sure your brackets are always in pairs.
While aye, this is good, you don't have your braces aligned with statements and other tokens...
ffc script example
{
void run(x,y)
{
while (true) //the 'w' in 'while' should aligh with the opening brace under it!
{
//code here
} // The closing brace aligns with the opening brace!
// This means that you can use the visual **alignment** to determine what scope ou are inside!
// Any code editor with its salt (I use SciTE), will highlight the braces so that
// you can see, with visible indication, which scoope a closing brace exits, ans similar.
] // This closing brace, **aligns with** the opening brace for run() !
} // This closing brace, **aligns with** the opening brace for tha 'script' token!
I
strongly advise using
tabs, to space out your indents.
Whether you put opening braces on a new line, or on the same line as a statement/function identifier/other, be sure to align everything so that you can easily keep tabs on it. Pun intended.
If you aren't using some kind of code-editing text editor, please throw away whatever you use, and use a code editor. That'll sort quite a lot of this for you by default.
Edit: Apparently, Edge refuses to submit that code block with appropriate tabbing, and manually spacing also fails. Fawk Microsoft and Edge,
I had to correct it with Firefix. Now
that works, flawlessly.