Navigation

  • index
  • next |
  • previous |
  • PWCT 2.0 documentation »
  • Main Menu

Main Menu

In this chapter we are going to learn about the Main Menu

Introduction

We can create this program quickly using the Quick Start component

ib_quickstart_mainmenu.png

Program Steps

After selecting the (Main Menu) template, we will get the next steps in the Goal Designer

gd_quickstart_mainmenu.png

The Steps Tree:

While True
        Print  (New Line)
        Print Main Menu (New Line)
        Print -------------- (New Line)
        Print (1) Say Hello (New Line)
        Print (2) About (New Line)
        Print (3) Exit (New Line)
        Print  (New Line)
        Input nOption
        Switch nOption
                Case 1
                        Print Hello! (New Line)
                Case 2
                        Print Just a simple program! (New Line)
                Case 3
                        Print End of program! (New Line)
                        Shutdown 0
                Else
                        Print bad option... (New Line)
        End of Switch
End of While Loop

Creating the Program

To create this program we will use the next components

  • While

  • Print Text

  • Get Input

  • Switch

  • Case

  • Shutdown

  • Else

In the begining the Steps Tree is empty

1.png

Select the (While Loop) component

2.png

Enter the data in the Interaction Page

3.png

The Steps Tree will be updated

4.png

Select the (Print Text) component

5.png

In the Interaction Page, Just click OK

We will print an empty line!

6.png

The Steps Tree will be updated

7.png

We will print the Menu Items

8.png 9.png 10.png 11.png 12.png 13.png 14.png 15.png 16.png 17.png 18.png 19.png 20.png 21.png 22.png 23.png 24.png 25.png

Select the (Get Input) component

26.png

We will use the (nOption) variable to get the input from the User!

27.png 28.png

Using (Switch) we will determine what to do based on the selected option

29.png 30.png 31.png 32.png 33.png 34.png 35.png 36.png 37.png 38.png 39.png 40.png 41.png 42.png 43.png 44.png 45.png 46.png 47.png 48.png 49.png

Select the (Shutdown) component

Using this component we can close our program!

50.png 51.png 52.png 53.png 54.png 55.png 56.png 57.png

Now we have the final Steps Tree in our program

58.png

Logo

Table of Contents

  • Main Menu
    • Introduction
    • Program Steps
    • Creating the Program

Previous topic

Loop and Condition

Next topic

Dynamic Loop

Quick search

Navigation

  • index
  • next |
  • previous |
  • PWCT 2.0 documentation »
  • Main Menu
© Copyright 2023-2025, Mahmoud Fayed. Created using Sphinx 6.2.1.