Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations LittleInch on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quotes in relation text strings

  • Thread starter Thread starter jaybat12
  • Start date Start date
J

jaybat12

Guest
How do I show " in a text string as part of a relation? Ex: I want to show a pipe description by combining some parameters with some text strings.


To show


PIPE,
 
Create a parameter in the parameter list and enter the quote forit's value and insertthe parameterinto your description relation.
 
works. thanks.
 
You can use ' (single quote) instead of " in relation when you need to use " (double quote or inch symbol) as text.


i.e. DESCRIPTION = 'PIPE,
 
I was using 2 single quotes together but they don't show up properly in a BOM. they look more like this 2`` than like this 2"
 
What I meant was to use single quotes to enclose your text.


i.e. TEXT = '2"' (single quote, 2, double quote, single quote)


not TEXT = "2''" (double quote, 2,single quote, single quote, double quote)


Charles
 
Got it. thanks.
 
Ive got a similar problem...Im trying to use the show the
height x width x thickness in a description. i can get the
height and width but Im having problems getting it to show
"15 x 12 x .5". When I put the x in it shows an error. How
exactly are the quote marks suppose to be used in this
case?
 
You can't add a numerical value to a text string without
first converting the numerical value to text using the ITOS
command.
 
Can I not add text to a real number parameter?I can get 15
12 .5 to come up in the description. I just cant seem to
get "x".
 
THIS IS WHAT I HAVE SO FAR:
platewidth=d1
PLATELENGTH=d3+d4
PLATEHEIGHT=D5
DESCRIPTION= PLATEWIDTH
 
Combining real numbers and strings gets complicated. You
do have to convert the real numbers to text first using
ITSO. Below is what I use for a plate. HOR, VERT and
LENGTH are dimension names of the plate. W1, H1 and L1
are temporary values for the code. I use IF statements to
get the correct number of characters based on whether the
value has a tens place or a hundreds place. INCH is a
string parameter I added and assigned the value "

IF HOR < 1
W1= "."+EXTRACT(ITOS(HOR*100),1,2)
ELSE
IF HOR< 10
W1=EXTRACT(ITOS(HOR*100),1,1)+"."+EXTRACT(ITOS(HOR*100),2
,2)
ELSE
W1=EXTRACT(ITOS(HOR*100),1,2)+"."+EXTRACT(ITOS(HOR*100),3
,2)
ENDIF
ENDIF

IF VERT < 1
H1= "."+EXTRACT(ITOS(VERT*100),1,2)
ELSE
IF VERT < 10
H1=EXTRACT(ITOS(VERT*100),1,1)+"."+EXTRACT(ITOS(VERT*100)
,2,2)
ELSE
H1=EXTRACT(ITOS(VERT*100),1,2)+"."+EXTRACT(ITOS(VERT*100)
,3,2)
ENDIF
ENDIF

IF LENGTH < 1
L1= "."+EXTRACT(ITOS(LENGTH*100),1,2)
ELSE
IF LENGTH < 10
L1=EXTRACT(ITOS(LENGTH*100),1,1)+"."+EXTRACT(ITOS(LENGTH*
100),2,2)
ELSE
IF LENGTH >= 100
L1=EXTRACT(ITOS(LENGTH*100),1,3)+"."+EXTRACT(ITOS(LENGTH*
100),4,2)
ELSE
L1=EXTRACT(ITOS(LENGTH*100),1,2)+"."+EXTRACT(ITOS(LENGTH*
100),3,2)
ENDIF
ENDIF
ENDIF

DESCRIPTION= "PLATE, " +W1+INCH+" X "+H1+INCH+" X
"+L1+INCH+"LG"
 
What is the ,1,2) etc at the end of the statements?
 
The syntax for EXTRACT is EXTRACT(STRING, POSITION,
LENGTH). So EXTRACT("TRUCK",2,3) would return RUC.
 
ok. I got it to work. Thanks!!!
 
I have a situation where the "L" is less than .1 Does it
handle leading zeros differently?
 
It does not include leading zeroes, which are not necessary
when specifying English dimensions. If you need a leading
zero you can change the second line of the Length if
statement to

L1= "0."+EXTRACT(ITOS(LENGTH*100),1,2)
 

Part and Inventory Search

Sponsor

Back
Top