bas7advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
PRINT Statement Details
  Syntax  Details  Example                 Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
The PRINT statement outputs data to the screen.
 
PRINT  [expressionlist] [{;|,}]
    ■ The argument expressionlist can contain numeric or string expressions.
      String literals must be enclosed in quotation marks.
    ■ The PRINT statement supports only elementary BASIC data types
      (integers, long integers, single-precision real numbers, double-
      precision real numbers, currency, and strings). To print information
      from a record, use individual record element names in the PRINT
      statement, as in the following code fragment:
 
          TYPE MyType
            Word AS STRING * 20
            Count AS LONG
          END TYPE
          DIM Myrec AS MyType
 
          PRINT Myrec.Word
 
Usage Notes
    ■ Item-Format Rules
        -  A printed number is always followed by a space.
        -  If the number is positive, it is also preceded by a space;
           if the number is negative, it is preceded by a minus sign (-).
        -  If a single-precision number can be expressed as seven or fewer
           digits with no loss of accuracy, then it is printed in fixed-
           point format; otherwise, floating-point format is used. For
           example, the number 1.1E-6 is displayed as .0000011, but the
           number 1.1E-7 is displayed as 1.1E-7.
        -  If a double-precision number can be expressed as 15 or fewer
           digits and with no loss of accuracy, then it is printed in
           fixed-point format; otherwise, floating-point format is used.
           For example, the number 1.1D-14 is displayed as .000000000000011,
           but the number 1.1D-15 is displayed as 1.1D-15.
 
    ■ Print-Line Format Rules
        -  The print line is divided into print zones of 14 spaces each.
        -  The position of each printed item is determined by the
           punctuation used to separate the items in expressionlist:
             A semicolon makes the next value print immediately
             after the last value.
             A comma makes the next value print at the start of the
             next zone.
             Using one or more spaces or tabs between expressions
             has the same effect as using a semicolon.
        -  If a comma or a semicolon terminates the list of expressions, the
           next PRINT statement to execute prints on the same line, after
           spacing accordingly.
        -  If the expression list ends without a comma or a semicolon,
           a carriage-return-and-line-feed sequence are printed at the end of
           the line.
        -  If the printed line is wider than the screen width, BASIC
           goes to the next physical line and continues printing.