If you want to go for ksh (i would recommend that, sorry, Smiling Dragon), you do not need the "`expr ....`"-constructs. Further, you terminate your loops based on your knowledge how many array entries there are (3 in your case). You could make that dynamic so you wouldn't have to change the code there if you add more entries to your arrays.
Notice that "${#arr[*]}" gives you the number of elements in the array "arr[]". Inside double brackets you can do integer math: "(( var3 = var1 + var2 ))". You have to surround the brackets with spaces, though. "((var1..." is wrong, "(( var1..." is ok.
Code:
typeset arr[1]="first"
typeset arr[2]="second"
typeset arr[3]="third"
typeset arr[4]="fourth"
typeset -i index=1
(( index = 1 ))
while [ $index -le ${#arr[*]} ] ; do
print - "element to work on: ${arr[$index]}"
(( index =+ 1 ))
done
I hope this helps.
bakunin