Skip to content

Commit

Permalink
Fixed: Equalize export column order for SQL/LUA mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdvideo1234 committed Nov 7, 2024
1 parent ce9f634 commit 68641ac
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lua/autorun/trackassembly_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,7 @@ asmlib.NewTable("PIECES",{
end,
ExportDSV = function(oFile, makTab, tCache, fPref, sDelim, vSrc)
local defTab = makTab:GetDefinition()
local tSort = asmlib.Arrange(tCache, "Type", "Slot")
local tSort = asmlib.Arrange(tCache, "Type", "Name", "Slot")
if(not tSort) then oFile:Flush(); oFile:Close()
asmlib.LogInstance("("..fPref..") Cannot sort cache data",vSrc); return false end
local noSQL = asmlib.GetOpVar("MISS_NOSQL")
Expand Down Expand Up @@ -1890,16 +1890,17 @@ asmlib.NewTable("ADDITIONS",{
end,
ExportDSV = function(oFile, makTab, tCache, fPref, sDelim, vSrc)
local defTab = makTab:GetDefinition()
local tData = asmlib.Arrange(tCache)
for iRow = 1, tData.Size do
local tRow = tData[iRow]
local tSort = asmlib.Arrange(tCache, "Slot")
for iRow = 1, tSort.Size do
local tRow = tSort[iRow]
local sKey, tRec = tRow.Key, tRow.Rec
local sData = defTab.Name..sDelim..sKey
for iRec = 1, #tRec do local tData = tRec[iRec]; oFile:Write(sData)
for iRec = 1, #tRec do
local vRec = tRec[iRec]; oFile:Write(sData)
for iID = 2, defTab.Size do
local sC = makTab:GetColumnName(iID); if(not sC) then
asmlib.LogInstance("Cannot index "..asmlib.GetReport(iID,sKey),vSrc); return false end
local vData = tData[sC]; if(not sC) then
local vData = vRec[sC]; if(not sC) then
asmlib.LogInstance("Cannot extract "..asmlib.GetReport(iID,sKey),vSrc); return false end
local vM = makTab:Match(vData,iID,true,"\""); if(not asmlib.IsHere(vM)) then
asmlib.LogInstance("Cannot match "..asmlib.GetReport(iID,vData)); return false
Expand Down

0 comments on commit 68641ac

Please sign in to comment.