here in this code, I am trying to create an array of struct called Linestruct
but I am getting this error "bound error, attempts to access0-element array..."
using CSV
df=CSV.read("F:/B/Mayar/lineData.CSV")
struct Linestruct
buses::Vector{Int}
res::Float64
ind::Float64
imp_mag::Float64
imp_angle::Float64
p::Float64
q::Float64
state::String
end
CREATE_Linestruct() = Linestruct([0,0], 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, "overloaded")
Linestruct(buses_line, res_line, ind_line) = Linestruct(buses_line, res_line,
ind_line, 0.0, 0.0, 0.0, 0.0, "overloaded")
l2 = Linestruct([1,2,3], 0.0, 0.0)
l3=CREATE_Linestruct()
number_lines=size(df,1)
array_lines=Array{Linestruct,1}()
for x in 1:N
l4=CREATE_Linestruct()
array_lines[x]=l4
end