Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Generic errors show up in the upper part of the screen, as demonstrated below.

Image Removed

To do this, all you have to do is return the error message. Like this:

Code Block
string fruit = getElement(argv, 1);

if( isNull(fruit) ){
	return "What? You don't like fruits?";
}

 Image Added

Field Validation Errors

If you have multiple input fields on the screen, it would be nice to validate them all at once and show errors for each one.

...

Image Added

To do this, you will have to return an array containing pairs of label and error. 

...