04-17-2015 09:20 AM
Hi,
I'm using TestStand 2013 an I'm searching for a "Strip Path" function, which can retrive path name and file name from a coherent path-string.
Such a function exists in LabVIEW but I didn't found any comparable in TestStand.
Kind regard
Christian
Solved! Go to Solution.
04-17-2015 09:33 AM
There is not a native one that I'm aware of. I always use something like this:
Split((Split(Locals.Path,"\\")[(GetNumElements(Split(Locals.Path,"\\"))-1)]), ".")[0] //Get path name
Hope this helps,
04-20-2015 05:36 AM
Hi,
To get the path of the currently running sequence (or any other ) try this in a statement :
Locals.sequencepath = Left( RunState.SequenceFile.Path, Find(RunState.SequenceFile.Path, "\\", 0, True, True) ),
To get filename from path you can use MSCORBLIB function.
Add a .net action step.
Select MSCORBLIB assembly 4.0
Select root class "System.IO.Path (not creatable)"
Select .net invocation as "GetFileName(System.String)"
Hope this helps.
Ravi
04-24-2015 01:25 AM
Hi together,
thanks for all your replies. Now I've solve the request like follow:
Locals.FilePath = Left(RunState.SequenceFile.Path, Find(RunState.SequenceFile.Path, "\\", 0, True, True))
Locals.FileName = Mid(RunState.SequenceFile.Path, Find(RunState.SequenceFile.Path, "\\", 0, True, True)+1)
Kind regards
Christian
04-24-2015 08:25 AM
RunState.SequenceFile.AsPropertyObjectFile.DisplayName
Will give you the sequence file name.