Page 1 of 1

ChoreQuit doesn't display the error message

Posted: Tue Feb 07, 2012 4:47 am
by bunchukokoy
Hi Guys! :D

May I ask for your help. Attached is a screen shot of my TI included in a chore.
My user runs this chore, not the TI. But it seems when my user inputs an incorrect input format, the chorequit function doesn't work. Instead it shows, Chore Completed Successfully.

Please help. Am I missing something in this?

Thanks. :D
untitled.jpg
untitled.jpg (28.73 KiB) Viewed 2565 times

Re: ChoreQuit doesn't display the error message

Posted: Tue Feb 07, 2012 4:55 am
by rmackenzie
You are doing a ProcessQuit before your ChoreQuit... so it will never get round to processing that instruction because you already quit the process! Try removing that line (ProcessQuit) and see if that gives you the message log record you are looking for.

Re: ChoreQuit doesn't display the error message

Posted: Tue Feb 07, 2012 4:59 am
by Alan Kirk
bunchukokoy wrote:Hi Guys! :D

May I ask for your help. Attached is a screen shot of my TI included in a chore.
My user runs this chore, not the TI. But it seems when my user inputs an incorrect input format, the chorequit function doesn't work. Instead it shows, Chore Completed Successfully.

Please help. Am I missing something in this?

Thanks. :D
Yup. ChoreQuit isn't by itself an error; it's just a flow control statement. Consequently even if it quits, it's "succesful". If you want it to report that there's been an error (and don't mind the logs showing one), you have to generate an error.

The easiest way to do this is to put an ItemReject(); statement in your Prolog. (Yes, Itemreject has no real context outside of the Metadata and Data tabs, but it works anyway.)

Robin mentioned the point that I was going to make about the order of ProcessQuit and ChoreQuit but even if you fix that, you won't get an error for invalid input without creating the error.

Re: ChoreQuit doesn't display the error message

Posted: Tue Feb 07, 2012 5:16 am
by bunchukokoy
Thank you Sir Kirk and Sir Mackenzie!
Robin mentioned the point that I was going to make about the order of ProcessQuit and ChoreQuit but even if you fix that, you won't get an error for invalid input without creating the error.
Yes, this also doesn't prompt an error.

The easiest way to do this is to put an ItemReject(); statement in your Prolog.
This works good. Both processquit and chorequit don't give an error.

Tihengksalat!