Saving a data set

The engine.
Post Reply
Raa23
Posts: 1
Joined: Tue Feb 16, 2010 8:20 pm

Saving a data set

Post by Raa23 »

Hi,
I'm new in the forum so hello everybody first.
Actually I have 2 problems that I couldn't find how to solve:

1st:
I want to read a dataset, change one value in the record and save it again but I didn't find how to save a dataset.
Here is my code:

DSL_dataset dat;
dat.ReadFile("test.txt");
dat.SetInt(1,1,1);

And then I want to save it but there are no .WriteFile... So what can I do?

2nd:
Is it possible to write anything else besides an Int or a Float in a record of a dataset? like a char or a string?

Thank
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Saving a data set

Post by shooltz[BayesFusion] »

Raa23 wrote:Hi,
I want to read a dataset, change one value in the record and save it again but I didn't find how to save a dataset.
There's no DSL_dataset::WriteFile. You'll need to open the text file using fopen or ofstream, then iterate over the values and save them. If you only need to modify the file once, open it in GeNIe, change the value and save.
Is it possible to write anything else besides an Int or a Float in a record of a dataset? like a char or a string?
No, DSL_dataset stores numbers only. You can associate strings with integer values using DSL_dataset::SetStateNames.
Post Reply