Using an index should work quite well. Increment it upon finding '{', and decrement it upon finding '}', using its value in a loop to insert the spaces/tabs. Sounds interesting to me. If you post the...