Hi,
The problem could just be that you first need to create the column before declaring a dataset, such as:
int index =wksData.AddCol("name");
Dataset dsName( wksData, index);
I also want to comment that this example, automation.c, was written back in v7.0 and it reads directly from the data file line by line etc.
Since you have version 7.5, you may want to use the Import Wizard instead. With the Import Wizard, you can easily set up a filter to import your data file, and then on the last page of the wizard, you can specify script code to be executed at the end of the import. The script code can simply be a call to an Origin C function which then starts from the point where the import ends, and creates additional columns and performs computation/graphing etc. This way the actual importing of the data is taken care of without you having to code it, and you only supply code for what needs to be done after each import.
Once a filter (that optionally calls code to perform tasks at the end of the import) has been created, the wizard can then be used to import multiple files and then the code will be called at the end of each import.
There is also a batch processing tool on our file exchange page that allows you to organize this, and it works on the idea of a filter created using the import wizard:
http://www.originlab.com/fileexchange/details.aspx?fid=86
Easwar
OriginLab
Edited by - easwar on 12/17/2004 12:06:46 PM