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
Saving a data set
-
- Site Admin
- Posts: 1417
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Saving a data set
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.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.
No, DSL_dataset stores numbers only. You can associate strings with integer values using DSL_dataset::SetStateNames.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?