6. Messages > Printing Messages in LOGO

6.1. MESSAGES | Why need messages? | ABOUTPrint command |


6.1.1. Why do you need to print messages in LOGO?

You have drawn shapes and figures by moving the turtle with the help of various LOGO commands. But you cannot use these commands to write any text or message on the screen. Neither can you use these commands to carry out calculations like addition and subtraction on numbers.

Sometimes you may want to write some messages or solve sums. LOGO provides you commands to do so. You will learn how to print text messages on the screen using the <PRINT> Command.

Back to Top


6.1.2. PRINT Command

The <PRINT> command in LOGO is used to print a text on the screen. The short form of PRINT is PR. Message to be printed can consist of one or more words or even a sentence.

The syntax of PRINT command is:

PRINT "word

or

PRINT [sentence]

PRINTING A WORD

If you want to print a single word, the primitive name should be followed by an opening quotation mark before the word to be printed.

Example: PRINT "LOGO

On executing this command the word LOGO gets printed in the Commander Window.

 

PRINTING A SENTENCE

For displaying a message in the form of a sentence, the message to be displayed should be included within a pair of square brackets.

Example: PRINT [Welcome to the World of LOGO]

This command displays the sentence written within the square brackets in the Output/Command-Recall List box.

Back to Top


  ©2005 FINA'S CO.  HOME 

            

Hosted by www.Geocities.ws

1