Jump to content




[lua] [question] is there a way to go to a certain line in lua


  • You cannot reply to this topic
2 replies to this topic

#1 ETHANATOR360

  • Members
  • 423 posts
  • Locationyour hardrive

Posted 14 July 2012 - 04:49 PM

i am trying to make an OS but i want to know if there is a way to go to a certain line like the GOTO command in BASIC so i can simply cut back to the main menu of the OS

#2 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 14 July 2012 - 05:20 PM

GOTO?? No please! :P/>

Use if, elseif and else:
if <condition> then
  -- code
end

if <condition> then
  -- code
else
  -- code
end

if <condition> then
  -- code
elseif <condition2> then
  -- code
end
And functions:
local function doSomething()
  -- code
end

doSomething()


#3 ETHANATOR360

  • Members
  • 423 posts
  • Locationyour hardrive

Posted 15 July 2012 - 01:58 AM

ok thanks for the help and this OS was inspired by yours :P/>





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users