Chorn Sokun's Weblog

Conquer inner fear, push it to the limit!

read between the line

with 2 comments

It was last Friday when I tried to implement a UI for contractor register. Let see the code shall we?

if (!contractorTypeSelected)
{
    Flash["error"] = "Please select a contractor type";
    RedirectToStep("StepOne");
}
{
   DoNavigate();
}

Without knowing much detail it read like this “If the contractor’s type is not selected, flash an error and go back to step one otherwise take me to the next step“. It sounds pretty trivial right? well easy enough except it always take me to the next step no matter how bad the contractor’s type condition was ????!!!!!!

Now tell me what have I done wrong?

Advertisements

Written by Chorn Sokun

August 28, 2008 at 11:13 pm

2 Responses

Subscribe to comments with RSS.

  1. Shouldn’t there be an ‘else’ between line 05 and 06?

    Kenno

    August 30, 2008 at 7:20 pm

  2. Kenno you absolutely right and this kind of mistake was hard to see without reading between the line.

    chornsokun

    August 30, 2008 at 9:02 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: