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

Username:   Password: 
 RegisterRegister   
 Only Numbers
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
CyCLoBoT




PostPosted: Tue Feb 11, 2003 4:14 pm   Post subject: Only Numbers

How can I restrict in Turing so that the user can only enter numbers? Also the user can use backspace as well

Thanks
Sponsor
Sponsor
Sponsor
sponsor
Catalyst




PostPosted: Tue Feb 11, 2003 5:18 pm   Post subject: (No subject)

code:

var dir : string (1)
loop
    getch (dir)
    if index ("0123456789", dir) not= 0 or dir=chr(8) then
        put dir ..
    end if
end loop
CyCLoBoT




PostPosted: Tue Feb 11, 2003 5:40 pm   Post subject: (No subject)

This is exactly what I wanted. Thanks for your help Catalyst Smile
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: