C++ programing- less than and

if I have ten int variables, what’s the best way to say “If a is greater than b-j, do this; if b is greater than a and c-j, do this” etc.

I was thinking maybe saying “if a>(b and c and d and e and f and g and h and i and j) {…}”, but I’m not sure if that would do what I want or if there’s a more efficient way. Thanks!

Xojo.Maths Max function may be what you looking for.


for the most part, yes, but I need to determine which of a set of variables is, at that point, the greatest. When I use the max function, it claims “macro ‘max’ passed xxx arguments, but takes just 2”

What do I do with that? Do I need to download xojo libraries and use Max (as opposed to global “max” )?

Put the variables in an array. Sort the array or loop through the array to find the max value.

[code]Dim a, b, c, d, e, f, g, h, i, j As Integer
a = 3
b = 7

Select Case Max(a, b, c, d, e, f, g, h, i, j)
Case a

Case b


@Eli Ott that looks like just what I want, how would I notate that in standard c++ programming?

Wrong forum???