User input validation in Raptor flowchart

Introduction

In this article, we will learn how to perform user input validation in the RAPTOR flowchart. In this example, we will prompt the user to enter a number and we will display the number. It is a fairly easy example. But, the idea is to understand how do we validate the input.

User input validation

Sometimes, we get invalid inputs. For example, we asked the user to input a number. But,
the user might enter invalid inputs like strings, etc. In this flow chart, we will see
how to handle the situation.

Steps:

Launch the Raptor tool.
Drag & Drop an input symbol to the work area in middle to the start and stop symbols.

Enter the user prompt: “Please enter a number”

 

 

We will store the input into a variable called n.

Now place a selection symbol.

 

 

We will check the input with function Is_Number().

Is_Number(n)

In this flowchart context, valid input is a number. Anything, other than a number is invalid
input. For example, if we enter String instead of a number, the flowchart would prompt that the input is invalid.

 

Flowchart Input validation

 

Is_Number() function returns true if the input is number.

 

 

Input validation Examples

The above example stops displaying the error. We can even display an error and prompt the user to try again if the user enters invalid input. Example to try again can be found here:

Recursive way to validate user input in the flowchart:

https://www.testingdocs.com/questions/raptor-flowchart-to-find-the-number-of-digits-in-a-number/

https://www.testingdocs.com/questions/how-to-find-square-root-of-a-number-in-raptor-flowchart/

Similar functions

Similar functions that are useful to validate input are:
Is_Character(param)
This function returns true when the argument is a Character.
Is_String(param)
This function returns true when the argument is a String.

Is_Array(param)
This function returns true when the argument is an Array.

 

RAPTOR tutorial page: https://www.testingdocs.com/raptor-a-flowchart-tool/

Flowchart examples: https://www.testingdocs.com/raptor-flowchart-examples/

RAPTOR official website: https://raptor.martincarlisle.com/