VLNUNES Posted June 17, 2015 Report Share Posted June 17, 2015 Ola; Em uma série de números com no mínimo 2 e no máximo 10 números como pegar o menor e o maior valor ? EX: 21.00 – 21.10 – 25.13 -23.32 – 20.01 Neste caso pegar o 21.00 e 25.13 De uma forma mais trabalhosa (são 10 séries de números), eu posso jogar os números em um DBF temporário indexar e pegar os valores corretos, mas como pegar estes valores de outra forma ? Obrigado; Vander Quote Link to comment Share on other sites More sharing options...
Theotokos Posted June 17, 2015 Report Share Posted June 17, 2015 Jogue em um Vetor: Private aVetor := { } AADD(aVetor, 21.00 ) AADD(aVetor, 21.10 ) AADD(aVetor, 25.13 ) AADD(aVetor, 23.32 ) AADD(aVetor, 20.01 ) aVetor := Asort(aVetor,,,{|a,b| a < b}) nMenor := aVetor[1] nMaior := aVetor[Len(aVetor)] Quote Link to comment Share on other sites More sharing options...
VLNUNES Posted June 17, 2015 Author Report Share Posted June 17, 2015 Obrigado Theotokos, Resolvido com a função do Euclides ( Forum PCTOLEDO) use arquivo nMin := nMax := valor dbeval( {|| iif(nMin > valor, nMIn := valor,), iif(nMax < valor, nMax := valor,) } ) ? str(nMin)+str(nMax,15) Vander Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.