Example for lua table
2015-01-04 10:21
281 查看
a = {} for i=1, 10 do local sql = string.format("%d %s", i, os.date("%Y-%m-%d %H:%M:%S")) -- to_date('%s','yyyy-mm-dd hh24:mi:ss') 2015-01-04 10:09:38 a[i] = sql a.size = i -- the record of the table size end if type(a) == 'table' then for i=1, #a do print(a.i) -- nil print(a[i]) -- i 2015-01-04 10:09:38 end end
相关文章推荐
- lua的table.sort 中出现 invalid order function for sorting
- lua for通过循环table一些差异
- Lua中table.sort() 报错 attempt to compare number with nil和invalid order function for sorting
- lua的table.sort 中出现 invalid order function for sorting
- Here's an example that shows how to enumerate through the features of a selection set, returning the value of each field in the attribute table except for the geometry colum.
- PostgreSQL partition table's arithmetic tuning example
- create tcode for maintence table
- Mysql: Table name is specified twice, both as a target for UPDATE and as a separate source for data
- (原创) cocos2d-x 3.0+ lua 学习和工作(4) : 公共函数(8): 生成只读table
- mysqldump: Got error: 1142: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts' when using LOCK TABLES
- Lua判断Table是否为空的方法(空的table即{})
- You can't specify target table 'xxx' for update in FROM clause
- Error 3724:Cannot drop the table 'object_name' because it is being used for replication.
- Lua中使用table实现的其它5种数据结构
- lua排序table的闭包函数使用
- ERROR 1813 -Mysql:Tablespace for table 'xxx`.'xxx` exists.
- Lua 中得for while
- Scripts for monitoring oracle DB temporary tablespace by sql statement
- Lua table转string函数
- sqlserver sp_msforeachtable用法