views:

462

answers:

3

I have read an example and tried to duplicate it's methods but with weird results. This is a 1 shot deal so I do not want to buy a package to do this. Also, it will be executed on a Multi-Valued database in a Basic that not many programmers write in anymore. If anyone can post a small example of this It would be most helpful. Specifically, I need a box centered on an 8x11 paper with the left 1/3 filled in Green, the center 1/3 in Yellow and the last 1/3 in Red. Then Draw a line thru 3 points within each color of the box.

Thanks.

A: 

The simplest way is to draw 3 boxes. You'll have to position each one on your own doing your own math to determine where to start the first one to make it centered etc.

First position your cursor at the top left of the first box, draw it, move to the top left of the next box, draw it, and do the same for the last. Here is some code:

<esc>&u300D<esc>*t300R<esc>*p300x300Y<esc>*r3U<esc>*v2S<esc>*c300a300b5P<esc>*p600x300Y<esc>*r3U<esc>*v3S<esc>*c300a300b5P<esc>*p900x300Y<esc>*r3U<esc>*v1S<esc>*c300a300b5P

Here is the explanation:

<esc>&u300D<esc>*t300R -- set the Unit of Measure and Resolution (in this case 300 dpi)
<esc>*p300x300Y -- move cursor to 300x 300y (1 inch x 1 inch) 
<esc>*r3U<esc>*v2S -- set the color palette to RGB and use color 2 (green)
<esc>*c300a300b5P -- draw a box that is 300 wide and 300 tall, use current fill pattern
<esc>*p600x300Y -- move cursor to 600x 300y
<esc>*r3U<esc>*v3S -- set the color palette to RGB use color 3 (yellow)
<esc>*c300a300b5P -- draw a box that is 300 wide and 300 tall, use current fill pattern
<esc>*p900x300Y -- move cursor to 900x 300y
<esc>*r3U<esc>*v1S -- set the color palette to RGB use color 1 (red)
<esc>*c300a300b5P -- draw a box that is 300 wide and 300 tall, use current fill pattern

Here are the other colors and palettes, keep in mind this is the simple way, you can specify your own RGB etc.

RGB Palette
<esc>*r3U<esc>*v1S - Red                
<esc>*r3U<esc>*v2S - Green
<esc>*r3U<esc>*v3S - Yellow
<esc>*r3U<esc>*v4S - Blue
<esc>*r3U<esc>*v5S - Magenta
<esc>*r3U<esc>*v6S - Cyan

CMYK Palette
<esc>*r-3U<esc>*v1S - Cyan
<esc>*r-3U<esc>*v2S - Magenta
<esc>*r-3U<esc>*v3S - Blue
<esc>*r-3U<esc>*v4S - Yellow
<esc>*r-3U<esc>*v5S - Green
<esc>*r-3U<esc>*v6S - Red
<esc>*r-3U<esc>*v7S - Black
Douglas Anderson
A: 

Thanks for the code, it should work fine for the boxes. What I can not do, is draw a diagonal line that goes through each box

What I've seen is, this seems to require going into HP/GL2 to draw the lines. I can not seem to get the scale right.

CurtTampa
upload your PCL and I can take a quick look at it for you.
Douglas Anderson
A: 

Problem Solved: The error of my thinking was that it was a difference between 300 dpi and 600 dpi so I was dividing by 2 and the answer appeared almost correct. The Real problem was a difference between 3oo dpi and 720 Decipoints. The real factor needed to be 2.4 and now it works perfectly.

CurtTampa