Home > Software engineering >  This Lua foundation there is wrong in grammar?
This Lua foundation there is wrong in grammar?

Time:10-19

The local n1=1

Repeat

Break - here I want to exit the loop directly

N1 n1 + 1=

Until n1==4

Run go wrong? How to change the

CodePudding user response:

Lua syntax requires break and return can only appear at the end of the block

CodePudding user response:

Also if you want to enter the loop body is out of the first time, why still use cycle?

CodePudding user response:

reference 1st floor lx624909677 response:
Lua syntax requires break and return can only appear at the end of the block 1


I just make a test, block is what mean? How to change to not error, it is simple for an example of exit the loop line,

CodePudding user response:

reference qqsq001 reply: 3/f
Quote: refer to 1st floor lx624909677 response:

Lua syntax requires break and return can only appear at the end of the block 1


I just make a test, block is what mean? How to change to is not an error, is simply an example from circulation,

Is to say, exit the loop conditions, it is written in the book until later, that is your code of n1==4, cycle
  • Related