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

Username:   Password: 
 RegisterRegister   
 Help for getting a limited amount of letters Urgent
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
cam




PostPosted: Wed Jan 24, 2007 5:29 pm   Post subject: Help for getting a limited amount of letters Urgent

Right now I have this

var word : string (12)
get word


I've tried

get word (12)

So what command can I give to check to get only at most 12 letters?
Sponsor
Sponsor
Sponsor
sponsor
ericfourfour




PostPosted: Wed Jan 24, 2007 5:32 pm   Post subject: RE:Help for getting a limited amount of letters Urgent

I believe get word : 12 will work.

Turing:
var word :string
get word : 12
put word
cam




PostPosted: Wed Jan 24, 2007 6:09 pm   Post subject: Re: Help for getting a limited amount of letters Urgent

thx but it doesn't work... but if I were to do a if statement to bullet proof it? What would I use to see if the word has less then 12 letters?
ericfourfour




PostPosted: Wed Jan 24, 2007 6:39 pm   Post subject: RE:Help for getting a limited amount of letters Urgent

The one I showed only takes 12 characters from the keyboard buffer. The rest are left alone. If you want the user not to be able to type more than 12 characters, I suggest looking into: Input.getchar ().
cam




PostPosted: Wed Jan 24, 2007 7:24 pm   Post subject: Re: Help for getting a limited amount of letters Urgent

I think I'll just use Sad ) because I don't want to get even more complicated thank you
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  [ 5 Posts ]
Jump to:   


Style:  
Search: