Return to Statement


Return String with ASCII Value of n Example

This example demonstrates using the CHRSTR function to create a label for an object based on its current line font. If the line is solid the label is "A", if it is dashed, the label is "B", etc.

   ENTITY/L(4),LAB(4)
$$
$$ Geometry Definition
$$
&FONT=&SOLID
L(1)=LINE/0,0,0,1
&FONT=&DASHED
L(2)=LINE/0,1,1,1
&FONT=&PHANTM
L(3)=LINE/1,1,1,0
&FONT=&CLINE
L(4)=LINE/1,0,0,0
$$
$$Label Definition
$$
NUM=&FONT(L(1))
NUM=NUM+64
LAB(1)=LABEL/RIGHT,-1,.5,L(1),CHRSTR(NUM)
NUM=&FONT(L(2))
NUM=NUM+64
LAB(2)=LABEL/LEFT,.5,2,L(2),CHRSTR(NUM)
NUM=&FONT(L(3))
NUM=NUM+64
LAB(3)=LABEL/LEFT,2,.5,L(3),CHRSTR(NUM)
NUM=&FONT(L(4))
NUM=NUM+64
LAB(4)=LABEL/LEFT,.5,-2,L(4),CHRSTR(NUM)
HALT


CHRSTR Program Output

L(1) is labeled "A", L(2) is labeled "B", L(3) is labeled "C", and L(4) is labeled "D". The number 64 was added to the value extracted by the EDA &FONT because the value for solid is 1 and the ASCII value for "A" is 65.