Hmmm, I got the error once more (same one with CAT in it) with your new code. I can't seem to reproduce it easily though, though that is sometimes the case with memory errors. I only seem to have it with this paste function. I checked if there is not something else like a sys_marker that could add the 'CAT' but I have none in my code so I think the CAT is from str_cat.

Maybe it is conflicts with inkey itself?

I will keep an eye out and post here if the error occures again. Also changed the str_cat to str_cpy to see if the CAT changes to CPY or such.
Anyway thanks for the code.