Also, you arre using a zero-length var "$" with an old version of KiX and that will bite you when you embed vars in strings. I suggest you replace them with $RC or $NUL. Better still, don't embed vars in strings.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.