Anyone have anything better than this?
set int_1 = 1
set int_2 = 2
set int_3 = 3
set int_4 = 4
set int_5 = 5
set int_total = (int_1 + int_2 + int_3 + int_4 + int_5)
if (int_total >= int_maxvalue)
You can't do that, I'm afraid... and in your scenario there's not much value being added.
You could, for example, put the return variables into an Array of integers; however there's no specific 'sum of this array' method as an Array could hold ints, Strings, apples, or pears in Java.
If you did that you would then need a looping structure to go through the Array and add each value to another int; that would only be worthwhile if the number of elements in the array varied between executions of the script. Since you have static variables in this script, it all would just make it much more complicated and difficult to follow.
So to put it simply - what you have is simple to read, quick to execute, and works... so it's as good as it can be.
Please rate helpful posts...