Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 107 - 2505_CoreGPT(Podar)_Flipbook_C6
P. 107

    Using a Semicolon with PRINT

                     You can use the semicolon (;) with the PRINT statement if you want to print more than one thing
                     on the same line without spaces between them. For example:

                     PRINT "Your age is: ";

                     PRINT 15
                     The preceding statements prints Your age is: 15.
                     Why Use a Semicolon?

                     The semicolon  helps you print multiple  items  on the same  line without  adding extra  space

                     between them. In the example above, the semicolon tells the computer to keep the text "Your
                     age is:" and the number 15 together on the same line.
                     Without the semicolon, the computer would print them with a space in between like this:

                     Your age is:  15

                     REM Statement

                     As you know that the # symbol is used to write comments in BASIC-256 programs. You can also

                     use the REM statement instead of the # symbol to write comments.
                     For example:

                     REM "Comment"
                     END Statement

                     The END statement is used to specify the end point of the program. Statements written after the
                     END will not be executed by BASIC-256.  For example:

                     PRINT "Welcome"
                     END

                     PRINT "Touchpad"
                     Above statement will print only Welcome.

                     INPUT Statement

                     The INPUT statement is used to take the value from the user at run time. For example:

                     INPUT Name$

                     PRINT Name$
                     When you execute the preceding statements, you need to enter the name in the Text Output
                     Area. After entering the name when you press the Enter key, the entered name will be printed.
                     We can also use message with the INPUT statement. For example:

                     INPUT "Enter first number: ", num1

                                                                                    More on BASIC-256 Statements        105

| 102 103 104 105 106 107 108 109 110 111 112 |