I have a server path (or paths) that we want to do selections on the server name only.
Example: \\server1\Folder Path
var1 - mid(Path, index(Path,'\\', 1) + 2) to remove the first two slashes
var2 - RTrim(Path) - ??
What's the best way to accomplish removing everything after the slash after server1 and be flexible to handle different string lengths?
Thanks in advance
You can pick out the part of the path you want by using SubField()-function. This can be used both in a load script but also in the running application in the UI.
SubField( Path , '\' , 3 ) will pick out the server1
Since the first element is empty... the string starts with a backslash. The second part is empty - since there is nothing between the two first backslashes.
You can also index backwards by using a negative index. So SubField( Path , '\' , -1 ) will give you the text after the last backslash.