Re: [Tutor] validating user input for cli app

2010-10-07 Thread Alan Gauld
"Rance Hall" wrote I'd like to be able to just ask the question again, and re-validate the new input or offer a "press q to quit" option Thats what loops are for... The old GOTO syntax that everybody hates was ideal for this type of thing, if validation fails, just goto the question again

Re: [Tutor] validating user input for cli app

2010-10-07 Thread Steven D'Aprano
On Thu, 7 Oct 2010 12:09:31 pm Rance Hall wrote: > I know how to write the if statements to decide if the data entered > is valid or not, but I need a way to deal with what happens when it > is NOT valid. > > I'd like to be able to just ask the question again, and re-validate > the new input or of

[Tutor] validating user input for cli app

2010-10-07 Thread Rance Hall
I have the following scenario, during a cli app a function is called whose purpose is to get enough info from user to create a database record. Clearly the input values need to be validated. How do I handle the situation where validation fails, but the answer to the question is required. so far