~ k space in front of positive numbers.) press I RTN I. Aquarius will print these TWO LITERALS next to each other. (This is called CON· CATENATION.) The result will be 25. If you place quotes around only ONE number in an equation (PRINT "2" + 5), Aquarius will get totally confused and give you a TM Error message (TM means Type Mismatch - you tried to mix apples and oranges.) b.o ~ BACK TO PRINT ~ Ј. What happens if you forget the quotes around a literal? What have you noticed about the keyword PRINT? So far we have seen it followed by either: ~ .... s- Type: PRINT HELLO and press I RTN I. • Characters enclosed in quotes (called LITERALS) ...
Your Aquarius quickly informs you of your mistake by printing SN ERROR. (Syntax Error ... remember?) ~ PAINT "Hello" • An equation (the = sign is understood) NOT enclosed in quotes ... PRINT 2 + 5 ~ '~ Or what if you place quotes around an equation? Try it and see. Type: PRINT "2 * 5" and press I RTN I. This time you don't get an error message, but you don't get the result of your equation either. To get the best of both worlds, combine literals and equations with a SEMI· COLON. ..., BYTHEWAY ........ AN ABBREVIATION Sw PRINT can also be followed by VARIABLES (which you will learn about in Chapter 2) or a com- bination of literals. equations and variables ... PRINT A+ B.
FOR THE PRINT COMMAND IS THE QUESTION ~ MARK (?). EXAMPLE: ? "HELLO" or ? 2 * 5 B &... ~ ~ When the PRINT command is followed by LITERALS, Aquarius prints EVERYTHING inside the quotes. exactly as it is typed. ~ KEYIDEAS. Computers are fast, but unimaginative. They only do EXACTLY what you tell them to do. In general, every quote, comma, semi-colon, etc. has a very specific meaning. If you substitute one for another, you change the meaning of your command or statement. ~ When the PRINT command is followed by an EQUATION, Aquarius prints only the RESULT of the equation. (When Aquarius prints numbers. it prints a - sign in front of negative numbers and leaves a blank Type this:
PRINT "2 * 5 = .. : 2 * 5 \W When you press I RTN I. Aquarius will print: 2 * 5 = 10. M ANOTHER ALTERNATIVE: If you type PRINT "2" + "5" and ~ I J.Wiitl