Skip to content

Commit

Permalink
Improved: Reduce memory for indices (1) is the same as (1,2) unique
Browse files Browse the repository at this point in the history
Improved: Make sure to catch bad table column configuration on create
  • Loading branch information
dvdvideo1234 committed Sep 12, 2024
1 parent 48139fe commit 13c09bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lua/autorun/trackassembly_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ local asmlib = trackasmlib; if(not asmlib) then -- Module present
------------ CONFIGURE ASMLIB ------------

asmlib.InitBase("track","assembly")
asmlib.SetOpVar("TOOL_VERSION","8.785")
asmlib.SetOpVar("TOOL_VERSION","8.786")

------------ CONFIGURE GLOBAL INIT OPVARS ------------

Expand Down Expand Up @@ -1654,7 +1654,7 @@ propertiesAdd(gsOptionsCM, gtOptionsCM)

asmlib.NewTable("PIECES",{
Timer = gaTimerSet[1],
Index = {{1},{4},{1,4,Un=true}},
Index = {{1,4,Un=true}, {4}},
Trigs = {
Record = function(arLine, vSrc)
local noMD = asmlib.GetOpVar("MISS_NOMD")
Expand Down Expand Up @@ -1737,7 +1737,7 @@ asmlib.NewTable("PIECES",{

asmlib.NewTable("ADDITIONS",{
Timer = gaTimerSet[2],
Index = {{1},{4},{1,4,Un=true}},
Index = {{1,4,Un=true}, {4}},
Query = {
Record = {"%s","%s","%s","%d","%s","%s","%d","%d","%d","%d","%d","%d"},
ExportDSV = {1,4}
Expand Down Expand Up @@ -1790,7 +1790,7 @@ asmlib.NewTable("ADDITIONS",{

asmlib.NewTable("PHYSPROPERTIES",{
Timer = gaTimerSet[3],
Index = {{1},{2},{1,2,Un=true}},
Index = {{1,2,Un=true}, {2}},
Trigs = {
Record = function(arLine, vSrc)
local noTY = asmlib.GetOpVar("MISS_NOTP")
Expand Down
6 changes: 5 additions & 1 deletion lua/trackassembly/trackasmlib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3061,7 +3061,11 @@ function NewTable(sTable,defTab,bDelete,bReload)
end
else nA = qtDef.Size -- When called with no arguments is the same as picking all columns
for iCnt = 1, nA do
sStmt = sStmt..qtDef[iCnt][1]..(iCnt ~= nA and ", " or " )")
local tC = qtDef[iCnt]; if(not tC) then
LogInstance("Column missing "..GetReport(nA,iCnt), tabDef.Nick); return self:Deny() end
local sC = tostring(tC[1] or ""); if(IsBlank(sC)) then
LogInstance("Column mismatch "..GetReport(nA,iCnt),tabDef.Nick); return self:Deny() end
sStmt = sStmt..sC..(iCnt ~= nA and ", " or " )")
end
end; qtCmd[qtCmd.STMT] = sStmt; return self
end
Expand Down

0 comments on commit 13c09bf

Please sign in to comment.