数组(表)插入数据

admin2020-12-16  1.2K+

 var newResult={}
    table.insert(newResult,{order_id=22;title='dddddddddd'})
    table.insert(newResult,{order_id=25;title='eeee'})

    console.dump(newResult);

构造二级数组

应用

    p_result=grid.items;
    var newResult={}
    for k,v in table.eachIndex(p_result){
    	table.insert(newResult,{order_id=v[1];title=v[2]})
    }

    console.dump(newResult);
//结果
{
[1]={order_id=115;title=100};
[2]={order_id=56;title=49}
}

 

转载请注明原文地址: http://www.aardio.net/read-92.html
最新回复(0)
aardio问答
aardio编程语言