Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

What's the ; semicolon symbol in scripting?

Asked by
BiIinear 104
4 years ago
Edited 4 years ago

I watched a tutorial on LookVector today, happened to see this symbol ; on each end of every string that has = in it. Whats it for, exactly?

2 answers

Log in to vote
1
Answered by 4 years ago

I don't have a concrete answer but as far as i know it doesn't make a difference. I think it's used more to "fancy" up the script.

It functions as a regular comma and can be used interchangeably in a table.

local table1 = {
    1,2,3;4
}

It can also be used at the end of each line of code to increase programmer readability.

function test();
    print("foobar");
end;
0
So its useless, I guess all strings that use this cant go foobar either way. BiIinear 104 — 4y
0
In other programming languages its used as a `statement separator`. Lua doesn't need such a concept but languages like `C++` require this. EpicMetatableMoment 1444 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

In standard programming languages semicolons are used to signify to a compuer that a new line of code has been introduced.

However, LUA is a simplified language and does not require this. Even if you were to add semicolons after every line it wouldn't matter.

The reason other developers may type semicolons is because they're used to other programming languages and type them out of habit because they're used to seeing critical errors if they didn't.

Answer this question