19846Re: [Clip] Finding Minimum Value in Array
- Nov 2, 2009I am pretty sure you are just picking lucky numbers to use and thus
getting lucky :-)
I agree that you need the line breaks as delimiter because we are
sorting lines, not data elements. But it will not do what you wanted,
give the minimum unless you zero pad. You can however add zero padding,
sort, strip and output if you wish.
I mistakenly did not include the correct numbers in my prior example.
^!Info ^%Array1% ^%NL% ^%Array%
^!Info Array unsorted:^P^%Array%
^!Info Array correctly sorted:^P^%Array%
^!Info Minimum value: ^%Array1%
Notice I also used NL in my example because we figured that one out many
years ago -- look up my username and zero padding ....
329 comes out on top in the above examples because 3 is the lowest
number. Hugo and I have done the zero padding bit many times over the
years as I use his method for it.
> --- In email@example.com, Hugo Paulissen <hugopaulissen@...> wrote:
>> OK Don, Sorry Flo,
>> Forget my last post; I see what you mean... Now I *do* remember the padding zero issue! It's getting rusty inside...
> Hugo, Don,
> I don't think that Hugo was wrong. There has always been some confusion about this issue (cf message #19038 ff).
> The trick is the ^%NL% as delimiter. With the semicolon as the default delimiter the array won't get sorted:
- << Previous post in topic Next post in topic >>