上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 36 下一页
摘要: Obsolete 这个预定义特性标记了不应被使用的程序实体。它可以让您通知编译器丢弃某个特定的目标元素 实例 using System;public class MyClass{ [Obsolete("Don't use OldMethod, use NewMethod instead", true 阅读全文
posted @ 2020-07-18 21:34 流星曳尾 阅读(123) 评论(0) 推荐(0) 编辑
摘要: require "luasql.mysql"--创建环境对象env = luasql.mysql()--连接数据库conn = env:connect("数据库名","用户名","密码","IP地址",端口)--设置数据库的编码格式conn:execute"SET NAMES UTF8"--执行数据 阅读全文
posted @ 2020-07-15 21:18 流星曳尾 阅读(221) 评论(0) 推荐(0) 编辑
摘要: Meta classShape = {area = 0}-- 基础类方法 newfunction Shape:new (o,side) o = o or {} setmetatable(o, self) self.__index = self side = side or 0 self.area = 阅读全文
posted @ 2020-07-15 21:11 流星曳尾 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 方法 coroutine.create() 创建 coroutine,返回 coroutine, 参数是一个函数,当和 resume 配合使用的时候就唤醒函数调用 coroutine.resume() 重启 coroutine,和 create 配合使用 coroutine.yield() 挂起 c 阅读全文
posted @ 2020-07-15 16:20 流星曳尾 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Lua 的模块是由变量、函数等已知元素组成的 table -- 文件名为 module.lua-- 定义一个名为 module 的模块module = {} -- 定义一个常量module.constant = "这是一个常量" -- 定义一个函数function module.func1() io 阅读全文
posted @ 2020-07-15 14:07 流星曳尾 阅读(217) 评论(0) 推荐(0) 编辑
摘要: table.concat (table [, sep [, start [, end]]]): concat是concatenate(连锁, 连接)的缩写. table.concat()函数列出参数中指定table的数组部分从start位置到end位置的所有元素, 元素间以指定的分隔符(sep)隔开 阅读全文
posted @ 2020-07-15 13:29 流星曳尾 阅读(108) 评论(0) 推荐(0) 编辑
摘要: lua的下标默认从1开始,也可以指定数组索引值。 array = {}for i= -2, 2 do array[i] = i *2endfor i = -2,2 do print(array[i])end -4 -2 0 2 4多维数组以下是一个三行三列的阵列多维数组:-- 初始化数组array  阅读全文
posted @ 2020-07-14 16:11 流星曳尾 阅读(597) 评论(0) 推荐(0) 编辑
摘要: string.gsub(mainString,findString,replaceString,num) 在字符串中替换 mainString 为要操作的字符串, findString 为被替换的字符,replaceString 要替换的字符,num 替换次数 string.reverse(arg) 阅读全文
posted @ 2020-07-14 15:59 流星曳尾 阅读(88) 评论(0) 推荐(0) 编辑
摘要: optional_function_scope function function_name( argument1, argument2, argument3..., argumentn) function_body return result_params_comma_separated end 阅读全文
posted @ 2020-07-12 22:02 流星曳尾 阅读(179) 评论(0) 推荐(0) 编辑
摘要: if(布尔表达式) then --[ 在布尔表达式为 true 时执行的语句 --] end if(布尔表达式) then --[ 布尔表达式为 true 时执行该语句块 --] else --[ 布尔表达式为 false 时执行该语句块 --] end if( 布尔表达式 1) then --[ 阅读全文
posted @ 2020-07-12 17:11 流星曳尾 阅读(123) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 36 下一页