Liberty BASIC Help Online

PRINT
 
PRINT #handle, expression ; expression(s) ;
 
Description:
This statement is used to send data to the mainwin, to a disk file, or to other windows.  A series of expressions can follow PRINT, each separated by a semicolon.  Each expression is displayed in sequence.  If the data is being sent to a disk file, or to a window, then #handle must be present.
 
PRINTing to the mainwin:
 
After the expressions are displayed, the cursor (that blinking vertical bar | ) will move down to the next line, and the next time information is sent to the window, it will be placed on the next line down.  To prevent the cursor from moving immediately to the next line, add an additional semicolon to the end of the list of expressions.  This prevents the cursor from being moved down a line when the expressions are displayed.  The next time data is displayed, it will be added onto the end of the line of data displayed previously.
 
Usage:                  Produces:
 
  print "hello world"           hello world
 
  print "hello ";               hello world
  print "world"
 
  age = 23
  print "Ed is "; age; " years old"     Ed is 23 years old
 
When sending data to a disk file and in regard to the use of the semicolon at the end of the expression list, the rules are similar, although the result is not displayed on the screen.  Use of a semicolon at the end of a line suppresses the carriage return/line feed that causes text to be printed on the next line.  When printing to a window, the expressions sent are usually commands to the window (or requests for information from the window).  For more information, see GUI Programming.
 
 
 
 


Copyright (C) 2003 Shoptalk Systems
Liberty BASIC - http://www.libertybasic.com/