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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 How to save file ext. group created with LabTalk?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
no6b Posted - 03/25/2004 : 1:23:49 PM
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.
4   L A T E S T    R E P L I E S    (Newest First)
no6b Posted - 03/25/2004 : 5:18:15 PM
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
Mike Buess Posted - 03/25/2004 : 5:09:50 PM
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
no6b Posted - 03/25/2004 : 5:06:02 PM
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
Mike Buess Posted - 03/25/2004 : 3:46:47 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000