&args arg1 /* harvey 5/12/97 version 1.0 /* 11/19/2002: black and white /* draws a key /* These are the default values of the globl variables: /* .X none /* .Y none /* .kunit 1000 /* .kheight 100 /* .knunits 5 /* .textoff %.kheight% /* .ktext '5 km' &s savts [show textsize] &s savtj [show textj] &s savunits [show units] /* shadecolor black /* linecolor black &if %arg1% eq 'c' &then; &do &type Enter lower left corner units map &getpoint &s .X = %PNT$X% &s .Y = %PNT$Y% &end &if %arg1% eq 'reset' OR %arg1% eq 'RESET' &then; &do &type resetting parameters &set .kunit 1000 &set .knunits 5 &set .kheight 100 &delvar .textoff &set .textsz .1 &set .ktext '5 km' &return &end &if [locase %arg1%] eq 'auto' &then ; &do &s xmin [extract 1 [show mapex]] &s ymin [extract 2 [show mapex]] &s xmax [extract 3 [show mapex]] &s ymax [extract 3 [show mapex]] &s .kunit [[calc %xmax% - %xmin%] / 30] /* finish this later &end units map &if %arg1% cn 'PAR' OR %arg1% cn 'par' &then; &do &type parameters are: &type .kunit: %.kunit% &type .knunits: %.knunits% &type .kheight: %.kheight% &if [var .textoff] &then &type .textoff: %.textoff% &type .textsz: %.textsz% &type .ktext: %.ktext% &return &end units map &if ^ [variable .kunit] &then ; &set .kunit 1000 &if ^ [variable .knunits] &then ; &set .knunits 5 &if ^ [variable .kheight] &then ; &set .kheight 100 &if ^ [variable .textoff] &then ; &set .textoff [calc %.kheight% * 1.5] &if ^ [variable .textsz] &then ; &set .textsz .1 &if ^ [variable .ktext] &then ; &set .ktext '5 km' &s top [calc %.Y% + %.kheight%] &s bot [calc %.Y% - %.kheight%] &s color0 black &s color1 white &do i = 1 &to %.knunits% shadecolor [value color[mod [calc %i% + 1] 2]] patch [calc %.X% + ( %i% - 1 ) * %.kunit%] %bot% [calc %.X% + %i% * %.kunit%] %.Y% shadecolor [value color[mod %i% 2]] patch [calc %.X% + ( %i% - 1 ) * %.kunit%] %.Y% [calc %.X% + %i% * %.kunit%] %top% &end box %.X% %bot% [calc %.X% + %.kunit% * %.knunits%] %top% move [calc [calc %.X% + [ calc %.kunit% * %.knunits% / 2 ]]] [calc %.Y% - %.textoff%] textsize %.textsz% textj uc text %.ktext% textsize %savts% textjust %savtj% units %savunits% &return