I get
julia> x.Valve1
12-element Array{Bool,1}:
true
false
true
false
true
false
true
false
true
false
true
false
I even went to the trouble to build Julia 0.2.1 and test it there, too; same
result. So I can't replicate your problem. (I'm on Linux.)
How are you getting Julia? Building it yourself? Binary download? Anyway, it
sounds like you want to try a different way of getting Julia.
--Tim
On Monday, March 24, 2014 07:18:42 AM RecentConvert wrote:
> The updated code works the same with Status([1:12]) as it does with
> vector(Dstc["StatusW"]).
>
> type Status
> Valve1::Vector{Bool}
> Valve2::Vector{Bool}
> Valve3::Vector{Bool}
> Valve4::Vector{Bool}
> Valve5::Vector{Bool}
> Valve6::Vector{Bool}
> Valve7::Vector{Bool}
> Valve8::Vector{Bool}
>
> # Constructor for Status type
> function Status(vals::Array{Int64})
> l = int64(length(vals))
>
> Valve1 = Array(Bool,l)
> Valve2 = Array(Bool,l)
> Valve3 = Array(Bool,l)
> Valve4 = Array(Bool,l)
> Valve5 = Array(Bool,l)
> Valve6 = Array(Bool,l)
> Valve7 = Array(Bool,l)
> Valve8 = Array(Bool,l)
>
> # Parse Inputs
> for i=1:l
> # Byte 1
> Valve1[i] = vals[i] & 2^(1-1) > 0
> Valve2[i] = vals[i] & 2^(2-1) > 0
> Valve3[i] = vals[i] & 2^(3-1) > 0
> Valve4[i] = vals[i] & 2^(4-1) > 0
> Valve5[i] = vals[i] & 2^(5-1) > 0
> Valve6[i] = vals[i] & 2^(6-1) > 0
> Valve7[i] = vals[i] & 2^(7-1) > 0
> Valve8[i] = vals[i] & 2^(8-1) > 0
> end # End of conversion
>
>
> new(Valve1,Valve2,Valve3,Valve4,Valve5,Valve6,Valve7,Valve8)
>
>
> end # End of constructor
> end # End of type
>
> statuses = Status(vector(Dstc["StatusW"]))
> julia> typeof(statuses) Nothing (constructor with 1 method)
>
> julia> statuses.Valve1 ErrorException("type Nothing has no field Valve1")
>
>
>
> julia> x = Status([1:12])
>
> julia> typeof(x) Nothing (constructor with 1 method)
>
> julia> x.Valve1 ErrorException("type Nothing has no field Valve1")