function higher(a,b,c)
if a>b and a>c
value=a
endif
if b>a and b>c
value=b
endif
if c>a and c>b
value=c
endif
endfunction value
function middle(a,b,c)
if (a>b and a<c) or (a<b and a>c)
value=a
endif
if (b>a and b<c) or (b<a and b>c)
value=b
endif
if (c>a and c<b) or (c<a and c>b)
value=c
endif
endfunction value
function lower(a,b,c)
if (c<a) and (c<b)
value=c
endif
if (b<a) and (b<c)
value=b
endif
if (a<b) and (a<c)
value=a
endif
endfunction value
that should work, it looks a little long winded but actualy its`s shorter than trying to make a universal function that can return each of the values one by one according to a flag value or something, if you had more than three values to compare then you would find it worth the while to make something more elegant, but this simple method is easier for just comparing three values.
Mentor.
PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.