Commodore — Commodore Business Machines PET 2001 (EN)

The first BASIC command we shall explore will tell your PET to PRINT something on the screen. This is one of the more useful commands, for with it you can make your PET display data, draw pictures, or play games. seconds. Though the elapsed time may he different, you should See Now enter the following by pressing this sequence of keys. (We'll call it "typing" from this point on.) The first two digits .ire elapsed hours, the second two digits arc elapsed minutes, and the last two digits are elapsed seconds - which, in the above example, means that PET has been running for 00 hours, 1 1 minutes, and 30 seconds.

The time you see on your PET, however, will depend entirely on how long you have had it on thus far. PET's clock is crystal- controlled and very accurate. It is also a 24 hour clock which means it will count up to 23:59:59 then roll over to 00:00:00. Exercise 10- Printing on the screen Did your PET print HELLO PET on the screen? If it did not, then try it again. PRINT is a command which tells your PET what to do with the rest of the line. This example has a message between quotes. The quotes tell your PET to print out the message exactly as it appears within the quotes without any further processing. Exercise 12 - Setting the clock It is very easy to set your PET clock.

Assume it will be 12:30 p.m.. in a few seconds. Press the following sequence of keys: T I M E$=" 1 2 3 0 0 0" When the designated time ( 12:30 p.m..) comes up on your watch, pros' and PET will set the time. Substitute your current local time and try setting the clock as in the previous example. (If the time is 9:30, be sure to type "093000" you need 6 digits.) Exercise 11 - Using the built-in clock Now, whenever you type: Now, let us speak to your PET in BASIC and get it to tell you what time it is. Your PET has a built-in clock that starts from 0 the moment you turn on the computer. your PET will tell you the correct time.

Remember that if you turn the power off, the clock will stop running and you will have to reset it when you turn the power on again. Once you have reset it, though, you have a highly accurate built-in clock available at all times. Just To discover the elapsed time, type: type in ? T I M E S and there it is. The ? is a shorthand which you may use instead of always typing PRINT when you want your PET to print something. The $ at the end of the word TIME tells PET to print the time in hours/minutes/ Exercise 13- Solving mathematical problems www.commodore.ca BASIC is essentially an algebraic language which means that you can use your PET much as you would a pocket calculator.

Though it Free for personal use but you must have written permission to reproduce 13 23