Hi - new to Nim and working through a program to massage a large file of data
represented by the type
type TSegment* = object
ignore: bool
start: DateTime
finish: DateTime
duration: Duration
sequence: int
code: char
data: string
token: string
date: string
deductions: seq[int]
Run
I then create a sequence of that type
var segment: TSegment
var segments = newSeqofCap[TSegment](1)
Run
and add a bunch of segments to it.
segments.add(segment)
Run
So now I have a mutable sequence of TSegments, which can be accessed as
segments[x]. How do I initialize and add to segment[x].deductions? I've tried:
* directly initializing segment[x].deductions as
newSeqofCap[int](1)
Run
* creating a separate seq[int] and assigning it to segment[x].deductions
* creating a separate seq[int] and adding it to segment[x].deductions
but no luck.
Thanks!