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
 dataset<type>
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

5*10

Germany
Posts

Posted - 08/11/2005 :  10:20:27 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): OriginPro 7G
Operating System:Win 2000
Hi,
I have a little Problem with typing my Dataset.
In the Manual to the Programming guide is written, that it is possible to type a dataset to char.
The Progromming Guide is also able to compile an link it, but if I try to call this function followed message is plotted:

Warnung, Argumentfehler Datentyp
Laufzeitfehler in Origin C Funktion, allgemeiner Ausführungsfehler

i trie to translate it in english

warning argument failure in datatype
runtime error in origing c function, general ...failure

the code I compile is:

void test_schleife_File()
{
Worksheet wkstfa;
wkstfa.Create("0");
wkstfa.SetNumRows(500);
wkstfa.AddCol("File");
wkstfa.AddCol("Date");
wkstfa.AddCol("Time");
wkstfa.AddCol("Blq1");
wkstfa.AddCol("Blq2");
wkstfa.Columns(0).SetType(OKDATAOBJ_DESIGNATION_NONE);
wkstfa.Columns(1).SetType(OKDATAOBJ_DESIGNATION_NONE);
wkstfa.Columns(2).SetType(OKDATAOBJ_DESIGNATION_NONE);
wkstfa.Columns(3).SetType(OKDATAOBJ_DESIGNATION_NONE);
wkstfa.Columns(4).SetType(OKDATAOBJ_DESIGNATION_NONE);
wkstfa.Columns(0).SetFormat(OKCOLTYPE_TEXT_NUMERIC);
wkstfa.Columns(1).SetFormat(OKCOLTYPE_TEXT_NUMERIC);
wkstfa.Columns(2).SetFormat(OKCOLTYPE_TEXT_NUMERIC);
wkstfa.Columns(3).SetFormat(OKCOLTYPE_TEXT_NUMERIC);
wkstfa.Columns(4).SetFormat(OKCOLTYPE_TEXT_NUMERIC);
Dataset<char> dsFile(wkstfa, 0);
Dataset dsDate(wkstfa, 1);
Dataset dsTime(wkstfa, 2);
Dataset dsBlq1(wkstfa, 3);
Dataset dsBlq2(wkstfa, 4);
dsFile.SetSize(500);
dsDate.SetSize(500);
dsTime.SetSize(500);
dsBlq1.SetSize(500);
dsBlq2.SetSize(500);
}

I hope someone can help me!!

easwar

USA
1965 Posts

Posted - 08/11/2005 :  11:27:15 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi 5*10,

In order to write and read strings to/from a dataset column, you need to use a vector of type string and then use PutStringArray and GetStringArray methods.

For example:


Dataset dsFile(wks, 0);
StringArray sa(4);
// The above is same as vector<string> sa(4);

sa[0] = "File1";
sa[1] = "File2";
sa[2] = "File3";
sa[3] = "File4";

dsFile.PutStringArray(sa);



Easwar
OriginLab

Go to Top of Page

5*10

Germany
Posts

Posted - 08/12/2005 :  04:51:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Easwar,

thank you for helping. It works.

greets 5*10

P.S. I think we will see (write) us here more often!!
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