InsertJSONList() crashed if the list gets bigger.
In my following example, an IMA occurs directly at Max = 200,000 .... at 100,000 not yet.
It doesn't matter whether you use ASM or C-Backend.
With x64 the whole thing is no problem,
it rushes through without an error message, no matter how large the list is.
Code: Select all
Structure s_resultItem
AsString.s
AsNumber.q
EndStructure
Structure s_result
Map Column.s_resultItem()
EndStructure
NewList Row.s_result()
Procedure.i ExportResults(FileName.s, List Row.s_result())
Protected jSon = CreateJSON(#PB_Any, #PB_JSON_NoCase)
Protected Result = #False
If jSon
Debug ListSize(Row())
InsertJSONList(JSONValue(jSon), Row())
Result = SaveJSON(jSon, FileName, #PB_JSON_PrettyPrint)
FreeJSON(jSon)
EndIf
ProcedureReturn Result
EndProcedure
Filename.s = "R:\testfile.json" ; Change it !
Max = 200000 ; IMA at InsertJSONList()
;Max = 100000 ; No Error
For i=1 To Max
AddElement(Row())
For x = 65 To 89
Row()\Column(Chr(x))\AsString = Chr(x) + "a1"
Row()\Column(Chr(x))\AsNumber = Random(200000, 0)
Next x
Next i
ExportResults(Filename, Row())



