jrschmidt / grandpa-basic-1980

Programming 1980 style!! This project emulates an old fashioned line-numbered BASIC language machine. On a monochrome monitor, of course, and only upper case letters. Green, or amber if you want to get fancy with third party equipment. I have started a new project to convert this to Typescript (see `typescript` branch).
http://gb80-toquima.rhcloud.com/
0 stars 0 forks source link

Numeric value to string. #2

Open jrschmidt opened 9 years ago

jrschmidt commented 9 years ago

Currently, we can print a numeric value. For example:

120 PRINT X

will print the value of the numeric variable X. However, it can only print a numeric value on a separate line. If we implement a function in Grandpa BASIC to convert numeric values to strings, then users can use string concatenation to print numeric values combined with strings on one line.

For example, instead of

330 PRINT "THE AREA IS" 340 PRINT A 350 PRINT "SQUARE MILES"


THE AREA IS 482.68 SQUARE MILES

we could write something like

330 A2="THE AREA IS "+STR$(A)+" SQUARE MILES" 340 PRINT A2


THE AREA IS 482.68 SQUARE MILES