This code not working. Please suggest how to modify it
file_name = Pick File ( "Select a file to open" ); // this line of code is workingfolder_path = file_name << Get Directory() ; // this line of code not working.
Thanks.
try
folder_path = substr(file_name, 1, length( file_name)- length(word(-1,file_name,"\/")))
That worked.
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);
</CODE>If you don't need to have "/" or "\" at the end of your folder path, you can drop the <CODE class=" language-jsl">|| "\" part.
</CODE>If you don't need to have "/" or "\" at the end of your folder path, you can drop the <CODE class=" language-jsl">|| "\"