Computer Science Canada [Help] Get Statements |
Author: | tjmoore1993 [ Mon Apr 27, 2009 7:04 pm ] |
Post subject: | [Help] Get Statements |
What is it you are trying to achieve? I am trying to get a reply from a user but only limiting them to entering a max of 8 characters. Describe what you have tried to solve this problem Honestly, I was not able to try things because I had no clue where to start. Please specify what version of Turing you are using I am using version 4.xx To summarize this, If it is possible to stop input after a certain ammount of characters. Please share what you know. Example: Rodney buttface < This is 15 characters long I want this Rodney b < 8 characters long |
Author: | Tony [ Mon Apr 27, 2009 7:12 pm ] | ||
Post subject: | RE:[Help] Get Statements | ||
read up documentation on get
Although that will not prevent them from typing more than 8 characters, just the reading part (and the rest will be left over in a buffer). Alternatively you could write your own read-buffer loop with getch |
Author: | tjmoore1993 [ Mon Apr 27, 2009 7:38 pm ] | ||
Post subject: | RE:[Help] Get Statements | ||
Problem solved thanks to Tony's excellent resourcing skills. ![]()
|
Author: | Tony [ Mon Apr 27, 2009 7:43 pm ] |
Post subject: | RE:[Help] Get Statements |
bonus Tonys-approval points will be given out for implementing the use of backspace ![]() |
Author: | tjmoore1993 [ Mon Apr 27, 2009 8:06 pm ] |
Post subject: | Re: RE:[Help] Get Statements |
I will work on it a bit more. That was just a simple fix ![]() |
Author: | Euphoracle [ Mon Apr 27, 2009 10:08 pm ] |
Post subject: | RE:[Help] Get Statements |
Problem now is that people can't back-space errors, right? |
Author: | Tony [ Mon Apr 27, 2009 10:23 pm ] |
Post subject: | RE:[Help] Get Statements |
and that one would have to type out a bunch of spaces, to enter a word less than 8 characters. |
Author: | Dusk Eagle [ Mon Apr 27, 2009 10:31 pm ] | ||
Post subject: | Re: [Help] Get Statements | ||
How about this Tony?
|
Author: | Tony [ Mon Apr 27, 2009 10:54 pm ] |
Post subject: | RE:[Help] Get Statements |
Crashes the program if you try to backspace on an empty string. |
Author: | Dusk Eagle [ Mon Apr 27, 2009 11:01 pm ] | ||
Post subject: | Re: [Help] Get Statements | ||
Well that's not hard to fix:
Are there any other errors with this program? Because I can't find any. |
Author: | Tony [ Mon Apr 27, 2009 11:39 pm ] |
Post subject: | RE:[Help] Get Statements |
I think that takes care of the backspace. ![]() |
Author: | tjmoore1993 [ Tue Apr 28, 2009 2:20 pm ] | ||
Post subject: | Re: [Help] Get Statements | ||
Dusk Eagle @ Mon Apr 27, 2009 11:01 pm wrote: Well that's not hard to fix:
Are there any other errors with this program? Because I can't find any. Error: You can not backspace when max characters are entered. Request: If possible could you make it work so if the key enter is pushed it will do an action but still maintain that 8 char limit. This really means a lot! |