Star Micronics NX-2415II user manual Programming With Basic

Models: NX-2415II

1 160
Download 160 pages 47.44 Kb
Page 125
Image 125
PROGRAMMING WITH BASIC

PROGRAMMING WITH BASIC

As an example of programming the printer on Microsoft BASIC, we have listed the program for the IBM-PC. This program runs in the downloadable condition.

1000

Set c

c

 

 

 

 

 

 

 

 

 

 

1010

E$=CHR$( 27 )

 

 

 

 

 

E

 

c

 

 

1020

D$=E$+’’xO”

 

 

 

 

 

‘ Draft

quality

 

 

1030

L$=E$+”X1“+E$+ “k”

 

 

 

 

‘Letter

quality

 

 

1040

RM$=L$+CHR$( O)

 

 

 

 

 

‘Roman

character

 

 

1050

H$=CHR$(9)

 

 

 

 

 

‘Horizontal

tab

 

1060

PI$=E$+”P”

 

 

 

 

 

‘Pica

pitch

 

 

1070

‘ Start

printing

 

 

 

 

 

 

 

 

 

 

 

1080

WIDTH “LPT1:’’.255

 

 

 

 

 

 

 

 

 

 

1090

LPRINT

E

 

 

;

 

 

 

 

 

‘Set

HT

 

1100

LPRINT

RM$;’’Resident

 

fonts

are:”

 

 

 

 

 

 

1110

LPRINT

H$;D$;’’Draft

characters,”;

 

 

 

 

 

 

1120

LPRINT

H$;L$;CHR$(0) ;“Roman

characters,”

 

 

 

 

 

1130

LPRINT

H$;L$;CHR$(l) ;“Sanserif

characters,”

 

 

 

 

1140

LPRINT

H$;L$;CHR$(2) ;“Courier

characters,”

 

 

 

 

 

1150

LPRINT

H$;L$;CHR$(3); “Prestige

characters,”

 

 

 

 

1160

LPRINT

H$;L$;cHR$(4) ;“Script

characters.”

 

 

 

 

 

1170

LPRINT

 

 

 

 

 

 

 

 

 

 

 

 

1180

LPRINT

RM$;’’Print pitches are:”

 

 

 

 

 

 

1190

LPRINT

F?$;PI$;’’Pica

pitch

(10 CPI),”;

 

 

 

 

 

1200

LPRINT

H$;E$; ’’M’’Eliteite

pitch

(12 CPI),”

 

 

 

 

 

1210

LPRINT

H$; E$; ’’g’’ Semiecondensedsed

pitch

(15

CPI),”

 

 

1220

LPRINT H$;PI$;

 

 

 

 

 

 

 

 

 

 

 

1230

LPRINT

CHR$(15);

 

 

 

 

‘Select

condensed

print

1240

LPRINT

“Condensed

pica

pitch

(17

CPI),”

 

 

 

 

 

1250

LPRINT

H$; E$; ’’M’’Condensedsed

elite

pitch

(20

CPI),”;

 

 

1260

LPRINT

CHR$(18)

 

 

 

 

 

‘Cancel

condensed

print

1270

LPRINT

H$;E$;’’P1”;

 

 

 

 

‘Select

proportional

spacing

1280

LPRINT

PI$;UNormal

proportional,”

 

 

 

 

 

 

1290

LPRINT

H$; CHR$(15) ;’’Condensed

proportional,”

 

;

 

 

1300

LPRINT

CHR$(18);

 

 

 

 

 

 

 

 

 

 

1310

LPRINT

E$;’’PO”

 

 

 

 

 

‘Cancel

proportional

spacing

1320

LPRINT

 

 

 

 

 

 

 

 

 

 

 

 

1330

LPRINT

H$; E$; ’’wl’’D oublebheightght

,“; E$;’’wO”

 

 

 

 

1340

LPRINT

H$;E$; ’’Wl’’Douhlehle

width,

“;E$;’’WO”

 

 

 

 

1350

LPRINT

H$;CHR$( 28) ;’’E’’;CHR$(2)

;“Triple

width.”;

 

 

1360

LPRINT CHR$(28) ;’’E’’;CHR$(O)

 

 

 

 

 

 

 

 

1370

LPRINT

 

 

 

 

 

 

 

 

 

 

 

 

1380

LPRINT

RM$;’’Various

line

and

character

spacings:”

 

 

1390

FOR 1=1

TO 7

 

 

 

 

 

 

 

 

 

 

 

1400

LPRINT

E$;’’A’’;CHR$(I);

 

 

 

‘Line

spacing

set

 

1410

LPRINT

E$;n “;CHR$(I);

 

 

 

‘Increase

 

character

space

1420

LPRINT H$;’’THE

SPACINGS ARE CHANGEDU

 

 

 

 

 

1430

NEXT 1

 

 

 

 

 

 

 

 

 

 

 

 

1440

FOR 1=’7 TO 1 STEP -1

 

 

 

 

 

 

 

 

 

1450

LPRINT

E$;’’A’’;CHR$(I);

 

 

 

‘Line

spacing

set

 

1460

LPRINT

E$;” “;CHR$(I);

 

 

 

‘Increase

 

character

space

1470

LPRINT H$;’’THE

SPACINGS ARE CHANGED”

 

 

 

 

 

1480

NEXT I

 

 

 

 

 

 

 

 

 

 

 

 

1490

LPRINT

E$;’’3’’;CHR$(3O)

;

 

 

‘Set

1/6”

line

spacing

Page 125
Image 125
Star Micronics NX-2415II user manual Programming With Basic