I

How theprogram works

Thisprogrambeginsby assigninga numberof printercommandsto BASIC stringvariables(lines1000to 1070).Youcanfindmostof thesecommands near the begiming of chapter4.

The WIDTH“LPT1:“255 statementin line 1090meansinfiniteline width. It preventsthe IBM-PCfrom insertingunwantedcarriagereturnsand line feeds in graphicsdata.

Actualprintingbeginsin line 1100.Usingthe preassignedcommands,the programprints samplesof its differentfonts, followedby samplesof the print pitches,then somedoubleand quadruple-sizedprinting.

Next comes the central attractionof the program: a line of text printed fourteentimesin expandingandcontractingloopstogiveabarreleffect.The workis doneby fourprintercommands:a commandsettingtherightmargin (line 1370);a centeringcommand(line 1390);a commandto vary the line spacing(lines 1410and 1460);and a commandto micro-adjustthe space betweencharactem(lines 1420and 1470).

Nexttheprogramreturnstonormalspacingandgivesa demonstrationofthe printer’sword-processingabilities:italicprinting,bold printing,underlin- ing, subscripts,etc.

The row of automobilesin the nextprintedline is createdby downloading two new characterpatterns,whichare printedin placeof the character“<” (character60). Detailscan be foundin Chapter5.

The finalpart of the programuses dot graphicsto print some“SW” logos withvariousdensities.Thedotpatternof thelogowasoriginallylaid outon graphpaper,then convertedto the datain lines 2370to 2630with the help of a calculator.Each numberrepresentseightverticaldots. (See “Graphics commands”in Chapter4 for details.)

The patternis printedin four rows,each eightdots high and 65 dots wide. Lines 1800 to 1870 read the dot data into a string array variablenamed LOGO$.Line 1880sets the line spacingto 8/72inch so that tie rows will connectvertically.The loop in lines 1890to 1990doesthe printingin four passesof the print head.

104

Page 113
Image 113
Star Micronics LC-200 user manual How theprogram works