TestingDocs.com
    Software Testing website
    • Automation
      • Selenium
      • JBehave Framework
    • Tutorials
      • MySQL Tutorials
      • Testlink
      • Maven
      • Git
    • IDEs
      • IntelliJ IDEA
      • Eclipse
    • Flowcharts
      • Flowgorithm
      • Raptor
    • About

    Raptor Flowchart

    User input validation in Raptor flowchart

    Raptor Flowcharts

    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. If the input is invalid we will display an error message to the user. The idea is to understand how to validate the user input to the flowchart.

    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)

    This function returns True when the argument n is a number. If the input argument n is not a number the function returns false. We can leverage this function using a IF control structure to validate number input.

    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.

     

    Example

    Check for positive integer

    For example, if the flowchart expects a positive integer as input, we can combine the above function with further checks.

    For integer the floor(n) == n holds true. And to be positive integer n should be > 0.

     

    Postive Integer User Input Validation

    Input validation Examples

    The above flowchart example halts after displaying an error message. We can even display an error message and prompt the user to Try again if the user enters invalid input.

    Such examples to prompt user to Try again after invalid input 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/

    Related Posts

    Install RAPTOR Avalonia CentOS

    Raptor Flowchart /

    Install RAPTOR Avalonia on CentOS

    RAPTOR Avalonia Edition Windows

    Raptor Flowchart /

    Download RAPTOR Avalonia Edition on Windows

    RAPTOR Editions

    Raptor Flowchart /

    RAPTOR Editions

    RAPTOR flowcart to write to a file output

    Raptor Flowchart /

    Write to a file with RAPTOR flowchart

    Sum of Squares Array Elements Modular Approach

    Raptor Flowchart /

    Sum of Squares of Given Array Elements

    ‹ Run Raptor flowchart on Ubuntu› Raptor Subcharts Demo Flowchart

    Recent Posts

    • ChatGPT Plans Free and PlusChatGPT Subscription Plans
    • Stellar Converter for Database ToolStellar Converter for Database
    • Stellar MySQL Log AnalyzerStellar Log Analyzer for MySQL
    • Stellar Repair for MySQLStellar Repair for MySQL
    • ChatGPT IntroductionChatGPT Capabilities
    • How to secure your SQL Database: Tips and Tricks
    • ChatGPT4 Conversational AI FeaturesChatGPT4 Conversational AI Features
    • Trends in Software EngineeringShaping the Future of Development: Exploring Key Trends in Software Engineering
    • Java PerformanceImproving Java Performance with Multithreading
    • QDrant Vector DatabaseOpen-source Vector Databases
    • Difference between PHP and JavaScript?
    • Bing AI Browser Web ContentBing Conversation Styles
    • ChatGPT PreviewChatGPT Introduction
    • Open Source AI Frameworks TensorFlowOpen Source AI Frameworks
    • Artificial Intelligence Tools

    Back to Top

    Links

    • Contact
    • Privacy Policy
    • Cookie Policy

    www.TestingDocs.com