The only two places where you can perform math functions are variable setting and $calc(). The latter is usually the most practical way to do what you want: $mid(%string,%num,$calc(%var + 1))