Extract path
Posted: Fri Jan 13, 2017 8:00 am
Is there any convenient (pre-built) way to extract the path part of a string that is returned from uifiledlg?
That is, from
@uifiledlg(%myFile, "prg", "open")
could I extract the path part of %myFile and separate it from the file part?
Best,
Kristian
Edit:
The current clunky solution that I have is:
Any smoother way is very welcome.
That is, from
@uifiledlg(%myFile, "prg", "open")
could I extract the path part of %myFile and separate it from the file part?
Best,
Kristian
Edit:
The current clunky solution that I have is:
Code: Select all
%pureFileName=""
for !currPos=1 to @length(%myFile)
if @mid(%myFile, !currPos, 1)="\" then
%pureFileName=""
else
%pureFileName=%pureFileName + @mid(%myFile, !currPos, 1)
endif
next
string file=%pureFileName
string Path=@replace(%myFile, %pureFileName, "")