No, there are better ways,
One is defining an array which contains the required numbers to be added at the right index. Your example would have index 1,2,3,4,5 all with the value 2, 8,9,10...19 with the value 1 and so on.
Then you can use the number you're processing to index the array and add the resulting number. This has the advantage that you can re-define the array at run-time.
Alternatively, you can use a single case structure with the number wired directly, and the case selector set to different ranges where the required operation is carried out in the respective case. This is less flexible.
These are just twqo examples which have occurred to me, there's probably lots of other ways too. 4 CASE structures isn't the best way anyhow.
Hope this helps
Shane.
PS in the pciture, please ignore the wrong positioning of the label <--8. It should be lower down, but I hope you get the idea.
Message Edited by shoneill on 02-23-2006 04:58 PM
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)