Computer Science Canada

Help for getting a limited amount of letters Urgent

Author:  cam [ 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?

Author:  ericfourfour [ 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

Author:  cam [ 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?

Author:  ericfourfour [ 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 ().

Author:  cam [ 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


: