Okay this seems like a bug, I've done this before no problem. Why am I getting 'subscript out of range' on line 78? The button input shouldn't work if it will go out of bounds!
I guess that CX is bigger than or equal to LEN(N$) when the error occurs.
Could you try to replace as follows?
[line 61]
Replace CX=CX+1 with CX=CX+(CX<(LEN(N$)-1))
[line 65]
Replace CX=CX-1 with CX=CX-(CX>0)