T O P I C R E V I E W |
Mike Buess |
Posted - 02/06/2005 : 3:58:03 PM 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 |
3 L A T E S T R E P L I E S (Newest First) |
cpyang |
Posted - 02/07/2005 : 12:14:25 PM 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 |
Mike Buess |
Posted - 02/07/2005 : 09:05:20 AM 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 |
cpyang |
Posted - 02/07/2005 : 08:46:50 AM 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 |
|
|