script error...
[1/5] from: mgkiourt:otenet:gr at: 2-Oct-2001 19:02
>>value1:1
>>value2:2
>>value3:3
print maximum(maximum value1 value2)value3
Script Error:value1 has no value...
Could you please elucidate and provide detailed correct code?
Thanks.
[2/5] from: joel:neely:fedex at: 2-Oct-2001 11:36
Spaces are your friend!
mgkiourt wrote:
> >>value1:1
> >>value2:2
<<quoted lines omitted: 4>>
> Thanks.
>> value1: 1
== 1
>> value2: 2
== 2
>> value3: 3
== 3
>> print maximum (maximum value1 value2) value3
3
-jn-
--
This sentence contradicts itself -- no actually it doesn't.
-- Doug Hofstadter
joel<dot>neely<at>fedex<dot>com
[3/5] from: hallvard:ystad:helpinhand at: 2-Oct-2001 18:45
>> value1: 1
== 1
>> value2: 2
== 2
>> value3: 3
== 3
>> print maximum (maximum value1 value2) value3
3
(Which means I'm not able to reproduce your error).
I think you should stick to the other proposed solution:
>> maximum-of reduce [value1 value2 value3]
== [3]
the maximum-of function takes a block and returns it from the point where it finds the
first occurence of the highest value:
>> maximum-of reduce [value1 value2 value3 value2 value3 value1]
== [3 2 3 1]
So to retrieve only the value you need, use 'first:
>> first maximum-of reduce [value1 value2 value3 value2 value3 value1]
== 3
~H
mgkiourt skrev (18.02 02.10.2001):
[4/5] from: mgkiourt::otenet::gr at: 2-Oct-2001 20:39
[5/5] from: joel:neely:fedex at: 2-Oct-2001 18:59
If you want the most flexible possible solution...
>> someblock
== [95 52 80 96 67 32 53 12 4 15]
>> last sort someblock
== 96
-jn-
mgkiourt wrote:
> ----- Original Message -----
> From: Joel Neely <[joel--neely--fedex--com]>
<<quoted lines omitted: 4>>
> Yes,they are.Thanks.If we had four numbers,what
> the solution will be?
--
; Joel Neely [joel--neely--fedex--com] 901-263-4460 38017/HKA/9677
REBOL [] foreach [order string] sort/skip reduce [ true "!"
false head reverse "rekcah" none "REBOL " prin "Just " "another "
] 2 [prin string] print ""
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted