The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 LabTalk bug in Origin 2015
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

mduds

Germany
Posts

Posted - 11/01/2014 :  10:43:44 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

cdrozdowski111

USA
247 Posts

Posted - 11/01/2014 :  1:19:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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).
Go to Top of Page

mduds

Germany
Posts

Posted - 11/03/2014 :  04:21:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

cdrozdowski111

USA
247 Posts

Posted - 11/03/2014 :  05:53:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000