Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Custom Text Field
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
copthesaint




PostPosted: Sat Feb 28, 2009 6:35 pm   Post subject: Custom Text Field

I spent today and made a Custom Text field
post comments if you wish or whatever



Custom Text Field.t
 Description:

Download
 Filename:  Custom Text Field.t
 Filesize:  4.49 KB
 Downloaded:  107 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
rubdoo




PostPosted: Sat Feb 28, 2009 7:51 pm   Post subject: RE:Custom Text Field

that's cool, it's fun trying to only type 1 letter XD
The_Bean




PostPosted: Sun Mar 01, 2009 1:34 pm   Post subject: 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.
Turing:

var key : char
loop
    if hasch then
        key:=getchar
        exit when key=chr(27)
        put key,' ',ord(key)
    end if
end loop
SNIPERDUDE




PostPosted: Sun Mar 01, 2009 9:35 pm   Post subject: Re: Custom Text Field

It is also necessary to clear the buffer of any characters once done using it.

Turing:
loop
    if hasch then
        key:=getchar
        text += ord(key)
        Input.Flush    %% Don't forget this
    end if
end loop
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: