Program BarCode(input,output); TYPE CODES = ' '..'_'; VAR C3of9 : array[codes] of string[16]; Result,lbcr,xxx,ns,j,nm,i,x,y,lm,z,cw : integer; dn,ch : char; bcr : string[255]; {U+} {A-} {X-} Procedure Set3of9; BEGIN C3of9[' ']:='@'+#0+#0+#0+'@'+'@'+'@'+#0+'@'+#0+'@'+'@'+'@'+#0+'@'+#0; C3of9['_']:='@'+#0+#0+#0+'@'+'@'+'@'+#0+'@'+#0+'@'+'@'+'@'+#0+'@'+#0; C3of9['*']:='@'+#0+#0+#0+'@'+#0+'@'+'@'+'@'+#0+'@'+'@'+'@'+#0+'@'+#0; C3of9['-']:='@'+#0+#0+#0+'@'+#0+'@'+#0+'@'+'@'+'@'+#0+'@'+'@'+'@'+#0; C3of9['.']:='@'+'@'+'@'+#0+#0+#0+'@'+#0+'@'+#0+'@'+'@'+'@'+#0+'@'+#0; C3of9['0']:='@'+#0+'@'+#0+#0+#0+'@'+'@'+'@'+#0+'@'+'@'+'@'+#0+'@'+#0; C3of9['1']:='@'+'@'+'@'+#0+'@'+#0+#0+#0+'@'+#0+'@'+#0+'@'+'@'+'@'+#0; C3of9['2']:='@'+#0+'@'+'@'+'@'+#0+#0+#0+'@'+#0+'@'+#0+'@'+'@'+'@'+#0; C3of9['3']:='@'+'@'+'@'+#0+'@'+'@'+'@'+#0+#0+#0+'@'+#0+'@'+#0+'@'+#0; C3of9['4']:='@'+#0+'@'+#0+#0+#0+'@'+'@'+'@'+#0+'@'+#0+'@'+'@'+'@'+#0; C3of9['5']:='@'+'@'+'@'+#0+'@'+#0+#0+#0+'@'+'@'+'@'+#0+'@'+#0+'@'+#0; C3of9['6']:='@'+#0+'@'+'@'+'@'+#0+#0+#0+'@'+'@'+'@'+#0+'@'+#0+'@'+#0; C3of9['7']:='@'+#0+'@'+#0+#0+#0+'@'+#0+'@'+'@'+'@'+#0+'@'+'@'+'@'+#0; C3of9['8']:='@'+'@'+'@'+#0+'@'+#0+#0+#0+'@'+#0+'@'+'@'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'@'+'@'+#0+'@'+#0+#0+#0+'@'+#0; C3of9['P']:='@'+#0+'@'+'@'+'@'+#0+'@'+'@'+'@'+#0+'@'+#0+#0+#0+'@'+#0; C3of9['Q']:='@'+#0+'@'+#0+'@'+#0+'@'+'@'+'@'+#0+#0+#0+'@'+'@'+'@'+#0; C3of9['R']:='@'+'@'+'@'+#0+'@'+#0+'@'+#0+'@'+'@'+'@'+#0+#0+#0+'@'+#0; C3of9['S']:='@'+#0+'@'+'@'+'@'+#0+'@'+#0+'@'+'@'+'@'+#0+#0+#0+'@'+#0; C3of9['T']:='@'+#0+'@'+#0+'@'+'@'+'@'+#0+'@'+'@'+'@'+#0+#0+#0+'@'+#0; C3of9['U']:='@'+'@'+'@'+#0+#0+#0+'@'+#0+'@'+#0+'@'+#0+'@'+'@'+'@'+#0; C3of9['V']:='@'+#0+#0+#0+'@'+'@'+'@'+#0+'@'+#0+'@'+#0+'@'+'@'+'@'+#0; C3of9['W']:='@'+'@'+'@'+#0+#0+#0+'@'+'@'+'@'+#0+'@'+#0+'@'+#0+'@'+#0; C3of9['X']:='@'+#0+#0+#0+'@'+#0+'@'+'@'+'@'+#0+'@'+#0+'@'+'@'+'@'+#0; C3of9['Y']:='@'+'@'+'@'+#0+#0+#0+'@'+#0+'@'+'@'+'@'+#0+'@'+#0+'@'+#0; C3of9['Z']:='@'+#0+#0+#0+'@'+'@'+'@'+#0+'@'+'@'+'@'+#0+'@'+#0+'@'+#0; END; { Set3of9 } Procedure Readcode; Begin bcr:=''; write('Enter string: '); readln(bcr); bcr := '*'+bcr+'*'; write('Enter number of copies: '); readln(nm); write('Number of spaces between codes: ');readln(ns); write('Enter Left Margin: '); Readln(lm); end; { Readcode } Procedure Printcode; Begin write(lst,^[,#51,#2,^[,#108,chr(lm)); writeln(lst); lbcr := (length(bcr)*16); cw:=trunc(lbcr/256); for y := 1 to 30 do begin write(lst,^[,'L',chr(lbcr),chr(cw)); for i := 1 to length(bcr) do begin ch := copy(bcr,i,1); ch := UpCase(ch); write(lst,C3of9[ch]); end; writeln(lst); end; begin writeln(lst,^[+'@'); for xxx := 1 to ((lm-1) + trunc(lm/2)) do write(lst,' '); writeln(lst,bcr); end; for x:=1 to ns do begin writeln(lst); end; end; { Printcode } Procedure MakeSpaces; VAR num,posi : integer; BEGIN posi := pos('_',bcr); if posi <> 0 then begin insert(' ',bcr,posi); delete(bcr,posi+1,1); MakeSpaces; end; END; Procedure Setup; Begin if paramcount = 0 then begin writeln(^[,'*',' Epson 3 of 9 Bar Code Printer'); writeln(' Copyright (C) 1985 by Gavin S. Patton'); writeln; readcode; end; if paramcount = 4 then begin bcr := '*'+paramstr(1)+'*'; val(paramstr(2),nm,Result); val(paramstr(3),ns,Result); val(paramstr(4),lm,Result); MakeSpaces; end; if (paramcount > 0) and (paramcount <>4) then begin writeln('*** Not enough parameters! ***'); writeln('--> Syntax: BARCODE string, #ofreps, #of lines between codes, lmargin'); writeln('--> Note: strings of more than one word = THIS/IS/A/TEST'); halt; end; end; {setup} Begin { Main } Set3of9; Setup; for j:=1 to nm do begin printcode; writeln(j,' labels completed.'); end; { printcode loop } End. { barcode }