MeeloJoin Date: 2008-07-04 Post Count: 14763 |
Does anyone know a reason for the following things to highlight?
"#" at the beginning of the script highlights green. I attempted to use the "#define" preprocessor directive from C++ with this, but it didn't work
"$" at the start of a line highlights red. I attempted to use the "var $name" syntax from PHP (And I also tried it with local instead of var), but it didn't work.
There's probably more, but I only found these.
|
|
DingDong272Top 100 PosterJoin Date: 2007-12-08 Post Count: 9860 |
I think the '#' may come from the C++ used to create the ROBLOX Application.
I have no clue about the php '$,' though. |
|
MeeloJoin Date: 2008-07-04 Post Count: 14763 |
I think php uses "var $" to declare a variable and it can be used in strings like:
var $a = "No";
echo "$a blah";
Now I'm no expert on PHP, but I think this would echo "No blah" |
|
XlegoXJoin Date: 2008-06-16 Post Count: 14955 |
Well, they certainly have no use in Lua syntax, and I doubt that Roblox did any modifications to the Lua interpreter.
It's probably just remenants from the component that they used to make the script editor. |
|
DingDong272Top 100 PosterJoin Date: 2007-12-08 Post Count: 9860 |
I just learned PHP and all you need is a $ sign.
$hi = "Hello";
echo $hi;
> Hello
$Hi = "Jack";
echo "$Hi and Jill went up the hill";
> Jack and Jill went up the hill |
|
MrDoomBringerTop 100 PosterJoin Date: 2006-11-21 Post Count: 6176 |
$ Is a special character in Lua.
#, if I remember correctly, will create a comment. |
|
XlegoXJoin Date: 2008-06-16 Post Count: 14955 |
Well, in the way they're highlighted they don't have a use, they only work at the start of lines. |
|
DingDong272Top 100 PosterJoin Date: 2007-12-08 Post Count: 9860 |
Doesn't appear to make comments to me. Here's the error:
"unexpected symbol near '#'"
Just got that error. |
|
MrDoomBringerTop 100 PosterJoin Date: 2006-11-21 Post Count: 6176 |
Ah, never mind then. They are special characters used for different things. |
|
XlegoXJoin Date: 2008-06-16 Post Count: 14955 |
I wonder what would happen if you defined "a" as a table globaly, and pasted in a script "#a", no...
Any way of using "#" as an LValue? |
|
DingDong272Top 100 PosterJoin Date: 2007-12-08 Post Count: 9860 |
_G.a = { #a }
Like that? |
|
|
That would just be
_G.a = {1} |
|
MeeloJoin Date: 2008-07-04 Post Count: 14763 |
Oh wait -
#a is the same as getmetatable(a).
Errr... I forget the meta event that is called... anyone have a complete list of them? |
|
XlegoXJoin Date: 2008-06-16 Post Count: 14955 |
Nah, you can't use # as an LValue...
Maybey the devs were originaly planning of using a different language than Lua that did use them...? |
|
|
MeeloJoin Date: 2008-07-04 Post Count: 14763 |
Anyways, it only highlights if it's the first character in the script - I mean, that can't be intentional, can it? |
|
DingDong272Top 100 PosterJoin Date: 2007-12-08 Post Count: 9860 |
Let's see how many conspiracy theories about the true use of ROBLOX's Lua we can come up with. |
|
earth100Join Date: 2007-12-13 Post Count: 2088 |
Wierd.
If "$" is the ONLY thing in the script Output says
Workspace.Script:1: unexpected symbol near '$' |
|
XJegoXJoin Date: 2009-08-20 Post Count: 9 |
BAWMPAMEELO |
|
dsds2Join Date: 2008-05-21 Post Count: 3851 |
They probably just leaked over from Scintilla. |
|
sncplay42Join Date: 2008-11-27 Post Count: 11891 |
Why are all these old threads being bumped?! |
|
Dr01d3k4Join Date: 2007-10-11 Post Count: 17916 |
XJegoX is doing it snc. |
|
sncplay42Join Date: 2008-11-27 Post Count: 11891 |
@Dr01d inorite? But why? |
|
Dr01d3k4Join Date: 2007-10-11 Post Count: 17916 |
The wheels on the phailbus go round and round, round and round, the wheels on the phailbus go round and round, all day long until it gets a flat tire. |
|
bloccoJoin Date: 2008-08-14 Post Count: 29474 |
On Notepad++ (My default editor), in Lua, the '#' in the first character in the script is green. Same with the red '$' in front of a line. |
|