Author Topic: Semicolons in LUA  (Read 4381 times)

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Semicolons in LUA
« on: June 12, 2010, 08:54:48 PM »
Typed on DSi

Is it possible to make lines in LUA run into each other? In JavaScript, you can use a semicolon -

var monkey=3
alert(monkey)

becomes

var monkey=3; alert(monkey)

and has the same effect. Can you do that in LUA, and what character would you use?

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Semicolons in LUA
« Reply #1 on: June 13, 2010, 08:23:21 AM »
I've no idea to be honest.
There's an LUA guide thingy linked near the bottom of the scripting reference sticky thread.  Maybe you can find something about it in there.  Or perhaps someone else can tell us.  :>

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Semicolons in LUA
« Reply #2 on: June 14, 2010, 12:38:14 AM »
I think you can, after looking on the LUA site, but I don't really want to do it for what I'm doing at the moment, it makes it easier to do, but makes for ugly code.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Semicolons in LUA
« Reply #3 on: June 14, 2010, 08:41:13 AM »
Yeah man, I absolutely believe in the importance of trying to create nice, neat code... with plenty of tabs...  and loads of comments to remind yourself later what stuff does.  Otherwise you have to go and re-learn everything and it just becomes far too sluggish to fix problems and introduce tweaks :>

The semicolon thing would be cool though, for things like creating a tree, then levelling it up three times.  It would be nice if you could do all of that on a single line.

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Semicolons in LUA
« Reply #4 on: June 14, 2010, 05:10:00 PM »
After having a look at the LUA site, I think you can, so yay! I'll just check it on Eufloria - it might start whinging.