Storing folder directory from user prompted file selectionThis 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.
Automation and ScriptingRe: Storing folder directory from user prompted file selectiontry
folder_path = substr(file_name, 1, length( file_name)-
length(word(-1,file_name,"\/")))
Re: Storing folder directory from user prompted file selectionThat worked.
Thanks.
Re: Storing folder directory from user prompted file selectionI 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.