13.07.2015 Views

Turbo Basic

Turbo Basic

Turbo Basic

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Constants<strong>Turbo</strong> <strong>Basic</strong> programs process two distinct classes of data: constants and variables(discussed after this section). A variable is allowed to change its value asa programruns. A constant's value is fixed at compile time and cannot change. during programexecution. <strong>Turbo</strong> <strong>Basic</strong> supports three types of constants: string constants, numericconstants, and in an extension to Interpretive BASIC, a special form of integerconstant, named constants.String ConstantsString constants are simply groups of characters surrounded by double quotes; forexample:"This is a string""3.14159""Tim Jones, Attorney at law"If a string constant is ,the last thing on a line, the closing quotes are optional:PRINT "This is sloppy but legal.Numeric ConstantsNumeric constants represent numeric values, and consist primarily of the digits 0through 9 and a decimal point. Negative constants need a leading minus sign (-);a plus sign (+) is optional for positive constants. The amount of precision yousupply determines the internal representation (integer, long integer, single precision,or double precision) <strong>Turbo</strong> <strong>Basic</strong> will use in processing that constant.If the value contains no decimal point and is in the range -32,768 to 32,767, then<strong>Turbo</strong> <strong>Basic</strong> uses its integer type.If the value is an integer in the range - 2 31 to 2 31 - 1 inclusive (about - 2 billion to+ 2 billion), yet outside the range for integer constants, <strong>Turbo</strong> <strong>Basic</strong> uses its longinteger type. (Note: The long integer type is not available in Interpretive BASIC.)If the value contains a decimal point, and has up to six digits, <strong>Turbo</strong> <strong>Basic</strong> usesits single-precision floating-point type.68 <strong>Turbo</strong> <strong>Basic</strong> Owner's Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!