|
| 27 Aug 2011 01:05 PM |
| Instead of commas, when do semicolons replace commas? |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2011 01:08 PM |
| semicolons aren't needed in ROBLOX. |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2011 01:09 PM |
| the semicolon (;) is used to indicate the end of a statement. It is optional. |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2011 01:11 PM |
They are needed...
I've seen scripts with semicolons. |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 27 Aug 2011 01:13 PM |
| Only in certain specific situations are semicolons ever needed. |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2011 01:13 PM |
| You may have seen them with semicolons, as they are tolerated. But they are not needed to run the code. |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 27 Aug 2011 01:13 PM |
They aren't needed.
I didn't latepost, someone just earlyposted:. |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 27 Aug 2011 01:15 PM |
They're needed in C++
// Signature code start Blocco::StartSignature(); Blocco::AppendToSignature("OHaider"); Blocco::EndSignature(); Blocco::FlushSignature(); // Signature code end |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2011 01:16 PM |
| Well semicolons look cool :3 |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 27 Aug 2011 01:19 PM |
I meant in Lua :c of course you need them in C++ after each argument.
I didn't latepost, someone just earlyposted:. |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2011 01:33 PM |
They ARE needed in Vector3 color for GUIs.
(255; 255; 255) |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 27 Aug 2011 01:35 PM |
No they aren't you use commas Color3.new(1, 1, 1)
I didn't latepost, someone just earlyposted:. |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2011 01:37 PM |
| Vector3? Ignore that... 0.e |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2011 01:40 PM |
Here is one of the only situations when semicolons are required.
(function() end)() (function() end)()
--error
(function() end)(); (function() end)()
--No error |
|
|
| Report Abuse |
|
|
Ozzypig
|
  |
| Joined: 27 Mar 2008 |
| Total Posts: 4906 |
|
|
| 27 Aug 2011 01:53 PM |
Semicolons can be used INSTEAD of commas in tables. This is valid:
a = {1;2;3} b = {hello="world";herp="derp"}
Semicolons are optional* in ending normal Lua statements:
a = 5; print(a); -->5
However, as stated above there are some exceptions:
(function () print("This is an anonymous function") end)() (function () print("This is another anonymous function") end)()
The above causes an error.
(function () print("This is an anonymous function") end)(); --a semicolon here ends this statement and calls the anon. function (function () print("This is another anonymous function") end)() |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 27 Aug 2011 02:15 PM |
They're not required in lua, but some people prefer to use them. This is usually how I've seen them used.
mahTable{ "blah" = 1234; "cake" = 1337; }
print(mahTable.blah) > 1234
______________________________________ ~pwnedu46~ -I lost the game.- I love making dooly-bops. ~ArceusInator
|
|
|
| Report Abuse |
|
|
| |
|