
-----------------------------------
copthesaint
Sat Feb 28, 2009 6:35 pm

Custom Text Field
-----------------------------------
I spent today and made a Custom Text field
post comments if you wish or whatever

-----------------------------------
rubdoo
Sat Feb 28, 2009 7:51 pm

RE:Custom Text Field
-----------------------------------
that's cool, it's fun trying to only type 1 letter XD

-----------------------------------
The_Bean
Sun Mar 01, 2009 1:34 pm

Re: Custom Text Field
-----------------------------------
1) Learn records, it will make things like this much more organized.
2) Learn flexible arrays, it will make the code shorter and faster.  And allow you to make more than 1 text field easier.
3) Use View.Set() not Window.Open() when your only using 1 window.
4) Make it work with View.Update().

Try using this when getting the key values, this way you don't have to go through all 255 checking to see if they are pressed.
And it already has the delays for the key being held down.

var key : char
loop
    if hasch then
        key:=getchar
        exit when key=chr(27)
        put key,' ',ord(key)
    end if
end loop


-----------------------------------
SNIPERDUDE
Sun Mar 01, 2009 9:35 pm

Re: Custom Text Field
-----------------------------------
It is also necessary to clear the buffer of any characters once done using it.

loop
    if hasch then
        key:=getchar
        text += ord(key)
        Input.Flush    %% Don't forget this
    end if
end loop
