Sending data

Function

Write data to the communications device file for sending.

Syntax

Detailed Description

The PRINT# statement writes the specified data to the communications device file for transmission--a command to a printer, for example.

Adding a semicolon to the PRINT statement suppresses the automatic carriage return normally added to the output.

Output control Output character
; (semicolon)

Suppress the automatic carriage return.

Program Output
PRINT #1, "ABC";"123"; ABC123
Blank

Add CR-LF pair.

Program Output
PRINT #1, "ABC123" ABC123 [CR] [LF]

Set fileno to the value specified when opening the communications device file.

Examples

Send the sequence "123456789", CR, LF via the CU
  open "COM1:115200" as #1
  print #1, "1234567890"
  close #1
Send the sequence ESC (1Bh), "M", LF (0Ah), NUL (00h) via the connector
  const ESC = chr$(&h1B)       ' define control codes
  const LF  = chr$(&h0A)
  const NUL = chr$(&h00)

  open "COM2:115200" as #1
  print #1, ESC;"M";LF;NUL;
  close #1

(C)2002-2004 DENSO WAVE INCORPORATED All right reserved