On Fri, Jul 22, 2016 at 3:09 PM, Cameron McBride <cameron.mcbr...@gmail.com>
wrote:

> julia> function get_event(v::Vector{ExampleEvent}, i)
>          n = length(v)
>          if i > n
>            for j in n:i
>                push!(v, ExampleEvent("",0,0,0,0,0,0)) # default values
>            end
>          end
>          v[i]
>        end
>

haha, that creates one extra element (ExampleEvent row) on the first pass.
Whoops. Here is a quick fix. Likely better ways to do all this, just
kicking it further.

julia> function get_event(v::Vector{ExampleEvent}, i)
         n = length(v)
         if i > n
           i1 = n > 0 ? n : 1
           for x in i1:i
               push!(v, ExampleEvent("",0,0,0,0,0,0)) # default values
           end
         end
         v[i]
       end

Cameron

Reply via email to