T O P I C R E V I E W |
InPc532 |
Posted - 01/06/2010 : 1:10:53 PM Origin Ver. and Service Release (Select Help-->About Origin): Origin 7.5 SR7 Operating System: Vista
I was trying to import text data and label it as part of a larger program, so to try to understand how this works, I copied one of the examples from the online wiki (http://ocwiki.originlab.com/index.php?title=OriginC:Import_ASCII#Version_Info) and pasted it. However, when I try to compile it, I get error messages about variables not being declared. Either I made a mistake that I still can't find, or some of the terms don't work in Origin 7.5.
This is the code I have so far: ****************************** #include <origin.h>
void TestImpAsc() { ASCIMP ai; string strFile = "C:\\Data\\test.txt";
if(AscImpReadFileStruct(strFile,&ai)==0) { ai.iAutoSubHeaderLines = 0; ai.iSubHeaderLines = 4; ai.nLongNames = ai.iHeaderLines; ai.nUnits = ai.iHeaderLines + 1; ai.nFirstUserParams = ai.iHeaderLines + 2; ai.nNumUserParams = 2; ai.iMaxLabels = 0; Worksheet wks; wks.Create(); wks.ImportASCII(strFile, ai); } } *********************** Compiling this gives the error: Error, data member not found:nLongNames; Error, Variable "ai.nLongNames" not declared. If I remove the green text, it successfully imports my test file, but I still need to generate column labels. I can't find any of these terms (nLongNames, etc.) in the help files, but I also can't find the ones that do work (iAutoSubHeaderLines, etc.), so if the version is the problem, I have no idea how to find the correct terms.
|
1 L A T E S T R E P L I E S (Newest First) |
Penn |
Posted - 01/07/2010 : 02:37:55 AM Hi,
I think you have noticed the version information of this example. It means the minimal version to run this example. The minimal version requirement of this example is Origin 8 SR0, so it can not get the correct results even though you get no error messages at compile-time.
There are big changes on worksheet structure from Origin 7.5 to Origin 8, such as Long Name, Units, Comments, etc., which DO NOT exist in Origin 7.5. You can refer to this wiki page for more information about the changes of worksheet from Origin 7.5 to Origin 8.
Now, our latest version is Origin 8.1, you can download a demo version to have a try first.
Penn OriginLab Technical Services |
|
|