SENDBREAK Statement

The SENDBREAK statement sends a BREAK sequence to the specified line.

Format

SENDBREAK TO line-expr [, n] [THEN statements1] [ELSE statements2]

Parameter(s)

line-expr

An expression evaluating to the line to send a break to.

n

An expression evaluating to the duration of the break signal, in milliseconds. Default is 500 milliseconds, and the maximum duration is 30,000 milliseconds (30 seconds).

THEN statements1

Executes statements1 if break signal is sent successfully.

ELSE statements2

Executes statements2 if break signal cannot be sent.

Description

The SENDBREAK statement sends a break to an attached line. If the line is not attached, the break sequence is not sent and the ELSE clause is executed.

Example

In this application, a program sends a break to a modem that recognizes a break as a signal to hang up. The length of the break is determined by the baud rate (which has been placed in the variable BAUD) in a CASE construct.

BEGIN CASE

CASE BAUD >=9600

   BREAKLEN=500

CASE BAUD >=4800

   BREAKLEN=1000

CASE BAUD >=2400

   BREAKLEN=2000

CASE BAUD >=1200

   BREAKLEN=4000

CASE BAUD >=300

   BREAKLEN=16000

ENDCASE

SENDBREAK TO MODEMLINE, BREAKLEN ELSE

   PRINT "COULD NOT HANG UP"

END

See Also

Statement and Function Reference