官术网_书友最值得收藏!

Assignment conventions

There are rules for variable names. A variable starts with a letter or an underscore. It can't contain anything other than letters, underscores, or digits. It also can't be one of the following reserved words of Lua:

  • and
  • break
  • do
  • else
  • elseif
  • end
  • false
  • for
  • function
  • if
  • in
  • local
  • nil
  • not
  • or
  • repeat
  • return
  • then
  • true
  • until
  • while

The following are valid variables:

  • x
  • X
  • ABC
  • _abc
  • test_01
  • myGroup

The following are invalid variables:

  • function
  • my-variable
  • 123

Note

Lua is also a case-sensitive language. For example, else is a reserved word, but Else and ELSE are two different, valid names.

主站蜘蛛池模板: 南宫市| 凤凰县| 泰兴市| 太原市| 太仓市| 漳平市| 隆回县| 滕州市| 鄄城县| 孝昌县| 宣化县| 马公市| 伊宁市| 黄大仙区| 五寨县| 时尚| 和田县| 会理县| 封开县| 江都市| 肃宁县| 拉萨市| 长沙县| 襄樊市| 平阳县| 翼城县| 醴陵市| 志丹县| 桂东县| 彩票| 开封市| 清水河县| 永德县| 泽州县| 平邑县| 东乡族自治县| 六盘水市| 灵璧县| 闸北区| 咸阳市| 富川|