Reader small image

You're reading from  Corona SDK Mobile Game Development: Beginner's Guide

Product typeBook
Published inMar 2015
Publisher
ISBN-139781783559343
Edition1st Edition
Tools
Right arrow
Author (1)
Michelle M Fernandez
Michelle M Fernandez
Right arrow

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.

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Corona SDK Mobile Game Development: Beginner's Guide
Published in: Mar 2015Publisher: ISBN-13: 9781783559343

Author (1)