home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1995 November
/
PCWK1195.iso
/
inne
/
podstawy
/
dos
/
4dos
/
4uzytki
/
4laser.exe
/
4LASER.BTM
next >
Wrap
Text File
|
1992-04-16
|
3KB
|
215 lines
@echo off
: LASER - Sends mnemonic printer commands to a LaserJet Series II printer.
:
: History:
: 16-Apr-92 MGiguere Added check & definition for WHILE aliases.
: 06-Apr-92 MGiguere Created.
:
setlocal
: dev: default printer port
set dev=lpt1
set pm=1
iff NOT isalias while then
alias while=`iff %& then`
alias endw*hile=`goto %1^endiff`
endiff
: parse command line into printer commands
:loop
while %# GE %pm
: get token
gosub lex
if "%debug" NE "" echo func=%func arg=%arg
: dispatch selected printer code generator
gosub %func
gosub exec
endw loop
quit
:lex
: return string token(s) from current position.
: look for =
set i=%@index[%[%pm],=]
iff %i LT 0 then
: function name only
set func=%[%pm]
set arg=
else
: function and arg. (func=arg)
set func=%@substr[%[%pm],0,%i]
set arg=%@substr[%[%pm],%@eval[%i+1]]
endiff
: update arg pointer
set pm=%@eval[%pm+1]
return
:exec
: execute a code string by sending it to the default device
if "%code" NE "" echos %code >%dev
if "%debug" NE "" echo code=%code
return
:
: ACTION SECTION BEGINS HERE
:
:c
:co
:cour
:courier
set code=eEe&l6De(10Ue(s0p10h12v0s0b3Tr
return
:l
:lin
:line
:linep
:lineprint
:lineprinter
set code=eEe&l10De(10Ue(s0p16.66h8.5v0s0b0Tr
return
:ty
:typ
:type
:typef
:typefa
:typefac
:typeface
: set typeface=[range: 0 to 10]
: 0 = line printer
: 1 = Pica
: 2 = Elite
: 3 = Courier
: 4 = Helvetica
: 5 = Times Roman
: 6 = Gothic
: 7 = Script
: 8 = Prestige
: 9 = Caslon
: 10 = Orator
iff %arg GE 0 .AND. %arg LE 10 then
set code=e(s%arg%Tr
else
set code=
echo Unknown Typeface: %arg, must be value: [0-10]
text
0 = line printer
1 = Pica
2 = Elite
3 = Courier
4 = Helvetica
5 = Times Roman
6 = Gothic
7 = Script
8 = Prestige
9 = Caslon
10 = Orator
endtext
endiff
return
:por
:port
:portr
:portrait
: select portrait page orientation
set code=e&l0Or
return
:la
:lan
:land
:lands
:landsc
:landscap
:landscape
: select landscape page orientation
set code=e&l1Or
return
:i
:it
:ita
:ital
:italic
set code=e(s1Sr
return
:ro
:rom
:roman
set code=e(s0Sr
return
:b
:bo
:bol
:bold
: set a bold stroke weight
set code=e(s3Br
return
:med
:medi
:medium
: set normal stroke weight
set code=e(s0Br
return
:lig
:ligh
:light
:lite
: set a light stroke weight
set code=e(s-3Br
return
:we
:wei
:weig
:weigh
:weight
: generic set of stroke weight=[range -7 to +7]
set code=e(s%arg%Br
return
:sy
:sym
:symb
:symbol
:symbols
:symbolset
: symbolset=[0N|0U|8N|8U|10N|10U|11N|11U]
set code=e(%argr
return
:cpi
:pi
:pit
:pitch
set code=e(s%arg%Hr
return
:v
:ver
:vert
:vertic
:vertical
:verticalp
:verticalpi
:verticalpit
:verticalpitch
: set vertical lines per inch
set code=e&l%arg%Dr
return
:po
:poi
:poin
:point
:points
:pointsi
:pointsiz
:pointsize
: set point size
set code=e(s%arg%vr
return
:re
:res
:rese
:reset
: reset laser printer
set code=eEr
return
:dev
:device
: sets the device port
set dev=%arg
set code=
return