Technically that code will work, but have you tried running it?
Unfortunately it will not do what you stated you want it to do.
You don't need to use an extra variable([a]) in the for-loop, because it has an intrinsic one that increments automatically; the one you used to declare it: [x].
There is also a command to retrieve the length, in elements, of an array, so calling entry$() again to set the upper bound of your for-loop will work, but since it creates needless overhead, it is unnecessary.
Another useful piece of information is that entry$(
1) will allow the effects of backspace to be seen.
So if you care, copy this code and run it to see what happens. You will need to type something in order for it to display anything.
do
cls
FillLetterArray()
PrintLetterArray()
loop
function FillLetterArray()
dim letter$( len(entry$(1)) )
for x = 1 to array count( letter$(0) )
letter$(x)=left$(entry$(1),x)
next x
endfunction
function PrintLetterArray()
set cursor 0,0
for x = 1 to array count( letter$(0) )
print letter$(x)
next x
endfunction
So now that its simplified, you need to use a different command to just retrieve a single character from the entry$ string: MID$() should work perfectly.
Replace
with
and you should be golden.
Cheers.