Example: Macros
Tk
followingprogramloadsandrunsa macro.Themacromovesan inch
anda halfrightanddownthreeinchesfromthe topleftcomerof thepage,
whereit printsa 25 percentgray-scalebar.It thenejectsthepaper.
100
LPRINT CHR$(27) ;“&f6X”
200
LPRINT CHR$(27) ; “&fIY”
300 LPRINTCHR$(27) ;“&fOX”
400 LPRINTCHR$(27) ; “*p450xl 200Y”;
500 LPRINTCHR$(27);“*c180h7200V”;
600 LPRINTCHR$(27); “*c25G”;
700 LPRINTCHR$(27); “*c2P” ;
800 LPRINTCHR$(12)
900 LPRINTCHR$(27);”&flX”;
1000 LPRINTCHR$(27);’’&f2X”;
11OO
END
LinclOOclcarsanyexistingmacros,thenline200spccificsthatthiswillbc
macroIDnumbcr 1.Linc300 startsdownloadingthemacro.
Linc400movestheprintpositiontoaspot450dotsrightand1200dolsdown
fromthe top left comerof the page.
Lines500 through700 selectthe 180-dotdeepand 7200-dotwidepattern
andprintit.Line800docstheformfeedthatforcestheactualprinting.Line
900endsthe downloadingprocess.
At [hetwolinewe selectourmacroand actuallyrun it.
97