cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
vibhu7668
Level I

Storing folder directory from user prompted file selection

This code not working. Please suggest how to modify it

 

file_name = Pick File ( "Select a file to open" ); // this line of code is working
folder_path = file_name << Get Directory() ; // this line of code not working.

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Storing folder directory from user prompted file selection

try


folder_path = substr(file_name, 1, length( file_name)- 
	length(word(-1,file_name,"\/")))
Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Storing folder directory from user prompted file selection

try


folder_path = substr(file_name, 1, length( file_name)- 
	length(word(-1,file_name,"\/")))
Jim
vibhu7668
Level I

Re: Storing folder directory from user prompted file selection

That worked.

 

Thanks.

jthi
Super User

Re: Storing folder directory from user prompted file selection

I like doing this using Word() with matrix to define the range of return (Word supports negative index)

Names Default To Here(1);

filepath = Convert File Path("$SAMPLE_DATA/Big Class.jmp", windows);

directory = Word([1 -2], filepath, "/\") || "\";

Show(filepath, directory);

If you don't need to have "/" or "\" at the end of your folder path, you can drop the || "\" part.

-Jarmo

Recommended Articles