'
' mData is a Map with key "color" and value a VertexData object
'
'
private Sub UtSave(raf As RandomAccessFile,mData As Map,pos As Long) As Long
raf.WriteInt(mData.Size,pos) ' cannot use directly raf.WriteObject(mData,true,pos); App is compiled but crashes saying that mData contains "primitives"
pos=pos+4 ' so I save the map size and each component
For Each color As Int In mData.Keys '
raf.WriteInt(color,pos)
pos=pos+4
raf.WriteObject(mData.Get(color),True,pos) ' mData.Get(color) is a VertexData object
pos=raf.CurrentPosition
Next
return pos
end sub
'' calling function
'
pos=UtSave(raf,ldata.pointMap,pos)
'