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
 Forum for Origin C
 Clueless import and column labels problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

InPc532

2 Posts

Posted - 01/06/2010 :  1:10:53 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

Penn

China
644 Posts

Posted - 01/07/2010 :  02:37:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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