Computer Science Canada error check with multi-word variables |
Author: | batgirl13 [ Thu Dec 04, 2008 8:08 pm ] | ||
Post subject: | error check with multi-word variables | ||
hi, im making a simple program; here is a section of the code.
at the moment, if you enter more than 1 word, it will display the error message once for every word. i need it to display once, showing all words that may have been entered. i know this is a simple fix, but i cant remember how to do it...help would be much appreciated. ![]() |
Author: | Zren [ Thu Dec 04, 2008 8:20 pm ] | ||
Post subject: | Re: error check with multi-word variables | ||
I think it's:
You might also wonna watch out for Y & N since they appear to be strings be sure to add the "Y". |
Author: | andrew. [ Thu Dec 04, 2008 11:25 pm ] | ||
Post subject: | RE:error check with multi-word variables | ||
Zren is right. Just add : * after your get line.
And yeah, you definitely have to change it from saying if ans = Y to if ans = "Y". |
Author: | Tyr_God_Of_War [ Thu Dec 04, 2008 11:30 pm ] |
Post subject: | RE:error check with multi-word variables |
And if you use index it will sort through the response for a phrase. I will post an example if you want. |
Author: | batgirl13 [ Thu Dec 04, 2008 11:45 pm ] |
Post subject: | RE:error check with multi-word variables |
ahh, thank you, knew it was something easy ![]() and thanks for the "" as well, i had those in the original program but forgot to type them in. |