[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: filename

I face this all the time, and must confess in being too lazy to write a
solution. I usually search for a delimiter from the string end
(Strpos(path, delimiter, /reverse)) or use Get_Path keyword, Strlen the
path and Strmid the returned value from that location to the end:

full_loc = Dialog_pickfile(get_path=path)
length = strlen(path)
file_name = strmid(full_loc, length)

Three lines of code; oh well. Need a wrapper function to make it one
line :-)


Gernot Reishofer wrote:
> hi,
> I have to save two files with the same filename but different
> extensions. Using DIALOG_PICKFILE creates path+filename+extention.
> Can you experts tell me the shortest way to get the filename avoiding
> too many string operations?
> thanks for help
> Gernot