locked
Return specific value on array from structure RRS feed

  • Question

  • User1010234884 posted

    hello everyone, i have a little problem to return some data, i have this

    Dim AvanKpiFor() As AvancesDesempeno
     Structure AvancesDesempeno
            Public FecAva1 As Date
            Public Avance As Double
            Public AvancePlot As Double
            Public TipLimPar As Byte
            Public LimSupPar As Double
            Public LimSupParMenos As Double
            Public LimInfPar As Double
            Public LimInfParMenos As Double
            Public AvanceFinal As Double
            Public TipLim As Byte
            Public LimSupFin As Double
            Public LimInfFin As Double
            Public LimSupFinMenos As Double
            Public LimInfFinMenos As Double
            Public MetaParcial As Double
            Public ImgNodo As Byte
            Public FecAva As String
            Public FecIni As String
            Public FecFin As String
            Public ImgNodoFinal As Byte
        End Structure

    when I return AvanKpiFor i get this:

    and it's fine, but when i try to get one array for some property i only get the first property for the first array, i tried this:

                For a As Integer = 0 To AvanKpiFor.Length - 1
                    Return AvanKpiFor(a).LimInfFin
                Next

    and this:

                Dim datos = AvanKpiFor.ToList()
                For Each element In datos
                    Dim lim = element.LimInfFin
                    Return lim
                Next

    but i just only get the first value for the first array, i just need something like this:

    LimInfFin = { 38.5, 39.5, 34, 35, 39.1, etc...  }

    maybe is a annoying question but i'm a little new with .net

    Thanks for the help,

    Regards

    Sunday, February 9, 2014 2:39 PM

Answers

  • User1010234884 posted

    sorry, annoying question, i resolved with this

    AvanKpiFor.Select(Function(a) a.LimSupFin).ToList()

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, February 9, 2014 5:32 PM

All replies

  • User1010234884 posted

    sorry, annoying question, i resolved with this

    AvanKpiFor.Select(Function(a) a.LimSupFin).ToList()

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, February 9, 2014 5:32 PM
  • User-97501952 posted

    Hi,

    Thanks for sharing solution with us.

    May

    Monday, February 10, 2014 3:26 AM