Perhapse my wording was not specific enough, you cant $+ LITERAL spaces. Using $str and $chr is a workaround, the point was that the problem with the OP's code is that $mid evaluates to a literal space, which is infact why it is not functioning as they expected.

I am well aware of the spaces issue, and that no single trailing space (in any form) can be used in that way. Although i am sure the OP will appreciate your explanation since i failed to do so myself.

To OP: you would need to check for this case, eg..
//var %t = GA is Ga, %b = $len(%t), %a 1 | while (%a <= %b) { if ( $mid(%t,%a,1) == $chr(32) ) { var -s %r = $+(%r,$mid(%t,%a,2)) | inc %a 2 } | else { var -s %r = $+(%r,$mid(%t,%a,1)) | inc %a } }

Last edited by Om3n; 10/04/07 02:22 PM.