I am having trouble with this (as shown in accompanying code) i have used this code before and it worked no problem but this time I am having to show a decimal number, I think it is known as an integer and I am getting errors with the figure sVal (stands for value). can someone look at the code and tell me what is wrong, as I have said it worked every time with just text values. Any help appreciated.
Code:
nHeader = 6; -- Set The Headers of The Grid tTableHeader = {"Item", "Item Name", "Bought From", "Serial Number", "Price", "Date of Purchase", "Notes etc"}; for i=0,nHeader,1 do sHeader = tTableHeader[i+1]; -- LUA Table starts from 1 not 0, so must add 1 to i Grid.SetCellText("Grid1", 0, i, sHeader, true); Grid.AutoSizeColumn("Grid1", i, GVS_DEFAULT, true, true); end -- set the header column to not select everything under it Grid.SetFixedColumnSelection("Grid1", false); -- set the item row to not select everything in the row Grid.SetFixedRowSelection("Grid1", false); -------------------------------------------------------------------------- nHeader = 7; sQuery = "SELECT * FROM Contents"; tbReturn = SQLite.QueryToTable(db,sQuery); if tbReturn then for i=1, tbReturn.Rows do Grid.InsertRow("Grid1", -1, true); --sID = MyDecrypt(tbReturn.Data[i]["ID"]); sName = MyDecrypt(tbReturn.Data[i]["Name"]); sShop = MyDecrypt(tbReturn.Data[i]["Shop"]); sSer = MyDecrypt(tbReturn.Data[i]["Serial"]); sVal = MyDecrypt(tbReturn.Data[i]["Price"]); sPur = MyDecrypt(tbReturn.Data[i]["Purchased"]); sNotes = MyDecrypt(tbReturn.Data[i]["Notes"]); tData = {i,sName,sShop,sSer,sVal,sPur,sNotes}; nColumn = 0; for x=1,nHeader do Grid.SetCellText("Grid1", i, nColumn, tData[x], true); Grid.AutoSizeColumn("Grid1", nColumn, GVS_DEFAULT, true, true); nColumn = nColumn+1; end Grid.AutoSizeRow("Grid1", i, true, true); Grid.ExpandLastColumn("Grid1", true); Grid.AutoSizeRows("Grid1", true); end -- for else Dialog.Message("Notice", "DB has no data", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); end -- count table
Comment