goto in Luaplayer ?

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
Julu Julu
Posts: 9
Joined: Tue Nov 01, 2005 8:57 am
Location: Germany

goto in Luaplayer ?

Post by Julu Julu »

Hi.

In the programming language C, there is an instruction -> goto

Has Luaplayer this instruction ?

Example:

Code: Select all

for x=0,100 do
   for y=0,100 do
      if y == 50 then
         goto abc
      end
   end
end

abc:
...
How can i break the 2 for's?
KawaGeo
Posts: 191
Joined: Sat Aug 27, 2005 6:52 am
Location: Calif Mountains

Post by KawaGeo »

Nope. Use "break" instead.

Note: one break from the inner loop. You need another break for the next loop if necessary.
Geo Massar
Retired Engineer
chaos
Posts: 135
Joined: Sun Apr 10, 2005 5:05 pm

Post by chaos »

functions are your friend.. why not use one of those instead?
Chaosmachine Studios: High Quality Homebrew.
Post Reply