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
 How to save file ext. group created with LabTalk?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

no6b

USA
4 Posts

Posted - 03/25/2004 :  1:23:49 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have the following script to create a new file extension group that I use with loading & saving colormap files in Origin 7:

System.FileExt.AddGroup(Colormaps);
System.FileExt.NumTypes=1;
System.FileExt.type1$="[Colormap files (*.dat)] *.dat";

For some reason, the System.FileExt.AddType() method doesn't work. But the above does, so I'm not worried about that. At any rate, I need to know how to save the new group so it's there the next time I start Origin. Apparently this information is stored in origin.ini, NOT option.cnf, so system.savePref() doesn't work either. Right now I have to open the options dialog box & change something so it asks me if I want to save the changes (including my file extension group addition via LabTalk). I'd like a LabTalk-way of doing this. Thanks.

Mike Buess

USA
3037 Posts

Posted - 03/25/2004 :  3:46:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
File extension information is saved in Origin.ini (FileExt section) and can be edited with the ini object. This would be done totally apart from the system.FileExt methods and the changes you make in Origin.ini will not take effect until the next time you start Origin. Here is the general approach...

1. Define your file extension group as you've already done.

2. Make the same changes to Origin.ini...

ini.file$=%YOrigin.ini;
numGroups=ini.FileExt.numGroups;
numGroups++;
ini.FileExt.numGroups=numGroups;
$(numGroups)_Name=Colormaps;
$(numGroups)_numTypes=1;
$(numGroups)_Type1$="[Colormap files (*.dat)] *.dat";
$(numGroups)_DefType=1;
$(numGroups)_OpenPathMode=1; // Open path setting from File Location options
$(numGroups)_SavePathMode=0; // Save path setting from File location options

The Open path (DefPath) and Save path (SavePath) values should take care of themselves. They are actually created (along with their respective Modes) by system.fileext.AddGroup().

...Unless you intend to create several File Extension groups then your method of finalizing the changes with the options dialog should be good enough.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 03/25/2004 3:49:40 PM

Edited by - Mike Buess on 03/25/2004 4:12:29 PM
Go to Top of Page

no6b

USA
4 Posts

Posted - 03/25/2004 :  5:06:02 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:

File extension information is saved in Origin.ini (FileExt section) and can be edited with the ini object. This would be done totally apart from the system.FileExt methods and the changes you make in Origin.ini will not take effect until the next time you start Origin. Here is the general approach...

1. Define your file extension group as you've already done.

2. Make the same changes to Origin.ini...

ini.file$=%YOrigin.ini;
numGroups=ini.FileExt.numGroups;
numGroups++;
ini.FileExt.numGroups=numGroups;
$(numGroups)_Name=Colormaps;



The above line fails. The value "--" is stored for Name instead of "Colormaps" in origin.ini. I also tried quotes around Colormaps; no luck.

Bob Dengler
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 03/25/2004 :  5:09:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I left out the string symbol. Should be this...

$(numGroups)_Name$=Colormaps;

See... I said the way you're already doing it is easier. :)

Mike Buess
Origin WebRing Member
Go to Top of Page

no6b

USA
4 Posts

Posted - 03/25/2004 :  5:18:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:

I left out the string symbol. Should be this...

$(numGroups)_Name$=Colormaps;

See... I said the way you're already doing it is easier. :)

Mike Buess
Origin WebRing Member


Yes, but I need the script to make my other scripts more portable (no instructions necessary other than just deposit the scripts & run the "install" script). Thanks.

Bob Dengler
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