Can Anyone explain how to use this snippet - oLast3Chars = Left(Right(oRefDoc.FullFileName, 7), 3)

Can Anyone explain how to use this snippet - oLast3Chars = Left(Right(oRefDoc.FullFileName, 7), 3)

J.VandeMerckt
Advocate Advocate
242 Views
2 Replies
Message 1 of 3

Can Anyone explain how to use this snippet - oLast3Chars = Left(Right(oRefDoc.FullFileName, 7), 3)

J.VandeMerckt
Advocate
Advocate
oLast3Chars = Left(Right(oRefDoc.FullFileName, 7), 3)

 I understand it uses the last 3 characters of the original name.

I would want to use the whole name but don't understand this Left and Right fully.

 

Can anyone elaborate for me?

Thank you.

0 Likes
Accepted solutions (1)
243 Views
2 Replies
Replies (2)
Message 2 of 3

Daan_M
Collaborator
Collaborator
Accepted solution

What do you mean exactly?

oRefDoc.FullFileName

 

Is what you need if you want the entire file name 

 

'Left' and 'Right' functions just cut out a part of a string

 

lets say I have 'abc'  and i use function:

 

Right('abc',2), the result will be: 'bc'

Left('abc',1), the result will be: 'a'

 

If you combine these function within eachother brackets, it will cut out a part of the already cut out part, so basically when i use the function i stated above:

 

Right('abc',2), the result will be: 'bc'

 

I can adjust this to Left(Right('abc',2),1), the result will be: 'b'

 

Because the result of my first function was 'bc' and i take the 1 left character from it, which is 'b'

 

0 Likes
Message 3 of 3

J.VandeMerckt
Advocate
Advocate

Ty sir, this is exactly the explanation I was hoping for.
I will try oRefDoc.FullFileName too.

0 Likes