Continue to Site

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.

Relations to Extract Characters

bjohnso2

New member
I am trying to find out if there is a way to extract the last 2 characters in a parameter string that will vary in length. I know you can use the extract command to specify your starting character and ending character (to determine the length of string you want to extract).<?:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" />


This would extract the first two characters of asm_mbr_dwg_no and assign it to first_two.


first_two = extract (asm_mbr_dwg_no,1,2)


Please let me know if there is a way.


Thanks,


Brian Johnson
 
The last 2 I don't think it's possible for a parameter that will vary in length.


But I think it will be possible if you find a function that will count the number of characters in a string. Then you can use that to have the last 2 characters. But I don't remember seeing sucha function....
 
string_length(param) will give the string length


Write these in relations:


count=string_length(param)
last=extract(param,count-1,2)



then last will return the last 2 characters in a string
 

Sponsor

Articles From 3DCAD World

Back
Top