beautypg.com

KEPCO BIT 232F User Manual

Page 71

background image

BIT 232 2/28/00

G-3

‘ ========================= FILTER ==========================

‘ Filters characters in an input string.

‘ ============================================================

SUB Filter (InString$) STATIC

‘ Look for backspace characters and recode them to

‘ CHR$(29) (the LEFT cursor key):

DO

BackSpace = INSTR(InString$, CHR$(8))

IF BackSpace THEN

MID$(InString$, BackSpace) = CHR$(29)

END IF

LOOP WHILE BackSpace

‘ Look for line-feed characters and remove any found:

DO

LineFeed = INSTR(InString$, CHR$(10))

IF LineFeed THEN

InString$ = LEFT$(InString$, LineFeed - 1) + MID$(InString$, LineFeed + 1)

END IF

LOOP WHILE LineFeed

END SUB

‘ ========================= Send Command =====================

‘ Send command line and wait for the command to be completed

‘ ============================================================

SUB SendCmmdWready (SendCmd$) STATIC

SendCommand SendCmd$

Notendcm = TRUE

WHILE Notendcm

‘ Check the modem. If characters are waiting (EOF(1) is

‘ true), get them and print them to the screen:

IF NOT EOF(1) THEN

‘ LOC(1) gives the number of characters waiting:

CharInput$ = INPUT$(LOC(1), #1)

IF CharInput$ = CHR$(62) THEN

Notendcm = FALSE

END IF

Filter CharInput$

PRINT CharInput$; ‘ backspaces, then print.

END IF

WEND

END SUB

This manual is related to the following products: