how to get the greatest value in array?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric

    how to get the greatest value in array?

    Hi,

    i have an array like x(1), x(2) ... x(10).
    Is there a simple way to get the greatest value?

    Thanks
    Eric


  • Gillard

    #2
    Re: how to get the greatest value in array?

    hi ,
    sort it
    and take the last one :D

    bye

    "Eric" <erl@sdsclem.po wrote in message
    news:OcCDPt7MJH A.1612@TK2MSFTN GP03.phx.gbl...
    Hi,
    >
    i have an array like x(1), x(2) ... x(10).
    Is there a simple way to get the greatest value?
    >
    Thanks
    Eric
    >

    Comment

    • =?Utf-8?B?Tmljb2xhcw==?=

      #3
      RE: how to get the greatest value in array?

      Can you use the SortedList which use (key,value) pair
      It sort by Keys and the get either enumarator to move
      Hope that help
      Nicolas

      "Eric" wrote:
      Hi,
      >
      i have an array like x(1), x(2) ... x(10).
      Is there a simple way to get the greatest value?
      >
      Thanks
      Eric
      >
      >
      >

      Comment

      • Armin Zingler

        #4
        Re: how to get the greatest value in array?

        "Eric" <erl@sdsclem.po schrieb
        Hi,
        >
        i have an array like x(1), x(2) ... x(10). Is there a simple way to
        get the greatest value?
        Framework 3.5:

        x.Max()


        Armin

        Comment

        • Eric

          #5
          Re: how to get the greatest value in array?

          Thanks all

          "Armin Zingler" <az.nospam@free net.deschreef in bericht
          news:uli3Y57MJH A.3744@TK2MSFTN GP05.phx.gbl...
          "Eric" <erl@sdsclem.po schrieb
          >Hi,
          >>
          >i have an array like x(1), x(2) ... x(10). Is there a simple way to
          >get the greatest value?
          >
          Framework 3.5:
          >
          x.Max()
          >
          >
          Armin

          Comment

          Working...