T O P I C R E V I E W |
mduds |
Posted - 11/01/2014 : 10:43:44 AM There is a bug in Origin 2015 which broke several of my macros:
The LabTalk command "GetFileName" does not work correctly. It opens the file dialog, but after chosing a file, the vaiables %A(should contain the file name) and %B (should contain the full path to the file) contain only garbage or nothing.
Manfred
|
3 L A T E S T R E P L I E S (Newest First) |
cdrozdowski111 |
Posted - 11/03/2014 : 05:53:48 AM I would be reluctant to rely long term on dlgfile assigning %A to the file name as, indeed, it isn't mentioned in the docs and may be subject to change. |
mduds |
Posted - 11/03/2014 : 04:21:17 AM Thank you, it works.
Interestingly, the X-Function dlgfile returns the full path with file name in the string "fname$", but also sets the variable %A correctly to the file name only. This is not mentioned in the documentation.
Manfred |
cdrozdowski111 |
Posted - 11/01/2014 : 1:19:50 PM There is a bug in 2015 SR0 with the LT getfile command that causes %A & %B to not work correcttly when files are on a different drive than your main drive. It is fixed in the next SR. I assume you have the same bug even if using the getfilename command.
In the meantime, you could switch over to using the X-Function dlgfile (http://www.originlab.com/doc/X-Function/ref/dlgFile) to get the selected file name into a string variable. Then use the methods of the String object to get the parts of the full file name you need to work with (http://www.originlab.com/doc/LabTalk/ref/String-obj). |