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

  • Lua Quick Start Guide
  • Gabor Szauer
  • 108字
  • 2021-08-05 10:30:35

Creating variables

To create a variable, you need to do two things:

  • Declare the variable
  • Assign a value (data) to the variable

As an example, let's make a variable, foo, and assign it the value bar. The code to do this would be:

foo = "bar"

That single line of code declares a variable and assigns a string value to the variable. If you break it into several parts, the actual line of code consists of the following pieces:

Why are there quote marks around bar? What is a string value? These questions will be answered in the coming two sections,  Basic types and  S tring types.
主站蜘蛛池模板: 固阳县| 读书| 呼玛县| 河源市| 如东县| 沽源县| 永顺县| 贞丰县| 弥渡县| 淮安市| 香港| 乌兰浩特市| 阳谷县| 石河子市| 宝山区| 杭州市| 丰镇市| 常熟市| 安福县| 东山县| 鄱阳县| 正阳县| 连平县| 汾西县| 布尔津县| 柳州市| 新巴尔虎右旗| 分宜县| 宾川县| 乌拉特中旗| 凤庆县| 安多县| 静宁县| 江口县| 通州市| 五莲县| 察隅县| 金秀| 肥城市| 乳山市| 广汉市|