Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Register Log in

use numeric value in string parameter

cschwie

New member
I have tried unsuccessfully to use a numeric value in a string parameter. This should be do-able somehow but it has not worked for me. For example: I have float variable LENGTH and I want to change string variable TITLE based on LENGTH. I tried something like:

TITLE = SCR-ALT,CAP,8-32X & LENGTH

I tried several other common programming techniques to create a string variable and they haven't worked. It might be possible but the help resources contained no info. about this problem.

This would be very useful for tabulated parts. I know it is possible to modify text notes in a drawing with parameters but this would not work as well.
 
G

Guest

Guest
charleskim,

as the LENGTH is a floating point value,

the relation is error
 

skraba

New member
The only problem with this procedure, charleskim, is the case, when you want real number in your string.



ITOS function (as the name says) converts Interger TO String, so if your numeric value is 3.6, ITOS function returns value 4.



And as far as I know, ther is no RTOS (Real number TO String) function yet.



Regards,

Jurij Skraba
 
You are right 'skraba'.

When you have real number(s), it gets little bit tricky.

Below is an example of converting real number into string.

Where A1, B1, and C1 are temporary values.

L is dimension for length.



A1 = L

B1 = FLOOR(A1)

C1 = (A1-B1)*100

IF C1 == 0

LENGTH = ITOS(B1) + .00

ELSE

LENGTH = ITOS(B1) + . + ITOS(C1)

ENDIF
 

Sponsor

Top