oops, sorry for the late reply. The forum didn't show me there are new messages in this thread.

Yes that command gives an error when %w contains a space. I think it could be solved by replacing that line with -
Code:
else bset &p $calc($bvar(&p,0) +1) $asc(%w)