Neal Matthews
2nd February 2004, 17:01
What's the easiest way to return the last five digits of the advice note number from the field tdssc017.ides
I'm sure that I've done this sort of thing before but I can't quite remember how and when I did it. Presumably you use the str$ function and then spilt the string up.
Cheers
Neal Matthews
Intier Automotive - IT Support Analyst
t.leijdens
2nd February 2004, 17:28
Hi,
if it is a string just point to the last characters:
you can use rdi.domain.string to determine the maximum length of the string by sending the proper domain. I am not sure it should be "tdides".
long str.size
long str.convert
rdi.domain.string("tdides", str.size, str.convert)
tdssc017.ides(str.size-5;5)
or just just go for tdssc017.ides(9;5) (if it is 13 characters)
In case of tdssc017.ides being a number try:
string str.ides(10) fixed
str.ides = str$(tdssc017.ides)
str.ides = shiftr$(str.ides)
now you can refer to the last 5 positions with str.ides(6;5)
Neal Matthews
3rd February 2004, 14:00
Thanks,
I had a slight complication of using an array to store the string but I got there.
Cheers
Neal
francishsu
4th February 2004, 00:40
Use the mod (backslash) operation to get the remainder after dividing the advice note number by 100000. (so the remainder will be 0 - 99999)
long last.5
last.5 = tdssc017.ides\100000
Francis