Advanced Programming Tips - HP 7470A Interfacing And Programming Manual

Graphic plotter
Hide thumbs Also See for HP 7470A:
Table of Contents

Advertisement

')
Advanced Programming Tips
;
)
)
)
)
)
o
• )
k >
( )
i )
o
o
o
( )
o
o
( . )
o
i.)
o
( )
When drawing labels, you often wish to position them precisely in rela­
tion to a specific point. Unless positioned differently by the programmer,
labels are written beginning at the current pen position which marks
the baseline of the label.
The following BASIC program illustrates various ways to center labels.
The program uses the BASIC command LEN($) to find the length of
the string. This length is used to determine horizontal adjustments, i.e.,
how many character-space widths the pen must be moved in order to
achieve the desired positioning. Vertical moves are in terms of character-
space heights. Since an uppercase letter is half the height of a character
space, a vertical movement of one-quarter character space down will
center uppercase letters on the point; notice the parameter is negative.
A parameter of —0.5 will cause the top of uppercase letters to be level
with the point.
Symbol mode plotting, with an * as the symbol, has been used here to
show pen position at the start of the label command. The character plot
instruction which positions the label is shown above each label.
10
DIM
fl$[40],B$[40],C$[401
20
fl$
= " T H I S LRBEL I S RIGHT JUSTIFIED"
30
PRINT
" S P 1 ; S M * ; P R 6 0 0 0 , 5 5 0 0 ; P D P U ; "
40
PRINT
" C P " ; - L E N C R S ) ; " 0 ; L B " ; R $ ; " V
50
B $ " " T H I S LRBEL I S CENTERED BELOW THE POINT"
60
PRINT " P A 4 5 0 0 , 5 0 0 0 ; P D P U ; "
70
PRINT "CP" ; - L E N ( B $ ) / 2 ; " - . 5 ; L B " ; B $ ; " V
80
C$=" VERTICALLY CENTERED LABEL'.'
90
PRINT " P R 2 ? 5 0 , 4 5 0 0 ; P D P U ; "
100
PRINT "CPO, - . 2 5 ; L B " ; C * ; " V
110
END
" C P " ; - L E N ( A $ ) ; " 0 ; "
THIS LABEL IS RIGHT JUSTIFIED*
"CP";-LEN(B$)/2;" -.5;"
THIS LABEL IS CENTERED BELOW THE POINT
"CPO,-.25;"
()
VERTICALLY CENTERED LABEL
( )
C)
' )
5-26 LABELING
i
)
Eq_43 Notes
i
LABELING 5-27

Advertisement

Table of Contents
loading

Table of Contents