Hahah thanks Rudolpho, Thats exactly what I did using the buffer entry.
That solved the init problems that I had, but now I seem to have created a 'problem' (its not so much a problem, just alittle buggy.. that sometimes it double deletes, others single and with so little code my brain is going mental cos ive tried to work it out.
global max_inputs = 3
global ipt as string
global wordNum as integer
global dim words(max_inputs,2) as string
wordNum = 1
do
text_cursor(wordNum)
text_print(wordNum)
text_cap(wordNum)
if keystate(28)=1 `enter was hit
if flag28 = 0
flag28 = 1
inc wordNum
if wordNum > max_inputs then wordNum = max_inputs
endif
else
flag28 = 0
endif
if keystate(15)=1 `tab was pressed
if flag15=0
flag15=1
if wordNum = max_inputs then wordNum = 1
dec wordNum
if wordNum < 1 then wordNum = 1
endif
else
flag15=0
endif
if keystate(14)=1 `backspace was pressed
if flag14 = 0
flag14 = 1
words(wordNum) = left$(words(wordNum),(len(words(wordNum))-2))
endif
else
flag14 = 0
endif
loop
function text_cap(wordNum as integer)
ipt = entry$()
clear entry buffer
words(wordNum) = words(wordNum) + ipt
endfunction
function text_print(wordNum as integer)
cls
print "Username:";words(1);words(1,2);""
print "Password:";words(2);words(2,2);""
print " Email:";words(3);words(3,2);""
endfunction
function text_cursor(wordNum as integer)
for I = 1 to max_inputs
words(I,2) = ""
next I
words(wordNum,2) = "<"
endfunction
as you can see i remove 2 characters from the right of the word.. if I dont it seems to add a space in somewhere then stops being able to delete.
If someone could have a quick flash over the code and probbly find where the +" " is coming from
if appreciate it.
P.s If anyone has any idea why/if its not possible to use keystates within the functions, or if the button has to be pressed while the function is running.. lemmie know.