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
 Origin Forum
 ORG or OPJ
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Mike Buess

USA
3037 Posts

Posted - 02/06/2005 :  3:58:03 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: XP

Is there a system variable that identifies an opened project as ORG or OPJ?

Mike Buess
Origin WebRing Member

cpyang

USA
1406 Posts

Posted - 02/07/2005 :  08:46:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
ORG was switched over to OPJ in Origin 4.0, the exact version was 4.01 in Feb 16, 1996 according to our code marking.

When an ORG/OPJ is opened, the variable T holds the file version, so you just need to test
if(T> 4.0)
type "it is an OPJ";
else
type "it is an ORG";



Please note that this T variable is transient, meaning that its value is not reliable after the file is open, as other parts of Origin, as well as user's LT script may modify it.
Also, starting with Origin 5, we have kept the file version separate from the software version, since the software is constantly changing while the file formats stay relatively unchanged.

CP





Edited by - cpyang on 02/07/2005 08:54:08 AM
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 02/07/2005 :  09:05:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Project.org and Project.opj are in the same folder. If I open Project.org in Origin and select File->Save the correct file (.org) is changed on disk. How does Origin know the correct file?

...Looks like you can take advantage of the fact the Origin write-protects the open project. This seems to work in Origin C

file ff;
if( ff.Open(Project.GetPath() + Project.GetName() + ".org", file::modeWrite) ) ff.Close();
else printf("Project is %s.org\n",Project.GetName());

if( ff.Open(Project.GetPath() + Project.GetNsme() + ".opj", file::modeWrite) ) ff.Close();
else printf("Project is %s.opj\n",Project.GetName());

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 02/07/2005 11:28:31 AM

Edited by - Mike Buess on 02/07/2005 11:48:42 AM
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 02/07/2005 :  12:14:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Your solution is very good. Indeed, there is an internal flag with that info about ORG, derived from file version, but not accessible.

For Origin 8, we can add BOOL bAddExtention to GetName for Project (7387).

CP




Edited by - cpyang on 02/07/2005 12:21:43 PM
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