SnarlyZoo
(SnarlyZoo)
July 25, 2020, 6:16pm
#1
I know what the dot .
does and what the colon :
does, but what do you use the semicolon ;
for?
I could not find anything on the developer roblox page covering it.
The SemiColon is not something that is really needed in Lua. In Java, for example, you have to use the SemiColon after EVERY variable declaration, but in Lua these two are the same (I thought I saw it a few weeks ago):
local String:string = "String"
--Is the Same as
local String:string = "String"; --Semicolon ^^
I’m pretty sure this question has been asked before, but well, happens sometimes. You really, REALLY don’t need it, okay? Trust me.
EDIT:
I found the topic:
The following article has a code example that uses “;”-notation for separating table entries:
http://wiki.roblox.com/index.php?title=API:Class/TweenService/Create
[image]
This notation can confuse less experienced users because they may not understand that the semicolon is also a way to separate table entries just like the comma. Most developers also adhere to the comma style for tables, and use the semicolon style only rarely. On the wiki, most if not all code examples with a table use comma…
Read it
1 Like
SnarlyZoo
(SnarlyZoo)
July 25, 2020, 6:21pm
#3
Ok so theres no point in using it? Gotcha
No point, jep. You should read this topic here:
The following article has a code example that uses “;”-notation for separating table entries:
http://wiki.roblox.com/index.php?title=API:Class/TweenService/Create
[image]
This notation can confuse less experienced users because they may not understand that the semicolon is also a way to separate table entries just like the comma. Most developers also adhere to the comma style for tables, and use the semicolon style only rarely. On the wiki, most if not all code examples with a table use comma…
This is only for the syntax.
EDIT:
No wait, i searched and its for Multistatementssomething:
lua, conventions
Try to read ^^
Hope this helps.
EDIT2:
Found a second link, read it!
There is an explanation of the need for them in statements in a single line, when you use parentheses to switch between two possible function calls, but again, this is a case forced to be in a single line, but it’s always better to just use multiple...
1 Like
Not needed and all it does is define a new line in rlua.
1 Like