Hi
please help me with this one.
I have a 2 dimensional array I would like to store into filestream.
TRec = record
Id:integer;
Name:string;
Prop_id:integer;
end;
As I tried I could only save records into filestream as one by one in one go. So everything is in one line.
The problem is to reverse the process, to load records back into array. So I put 'delimiter' between data, like '&&&&&'.
So line wold be:
1&&&&&ABC&&&&&0&&&&&2&&&&&DEF&&&&&0&&&&&3&&&&&GHI&&&&&1
this line shows 3 records. And I would load data into TList and extract each data into one line, so I would have :
List[0]=1
List[1]=ABC
List[2]=0
List[3]=2
List[4]=DEF
List[5]=0
List[6]=3
List[7]=GHI
List[8]=1
then I would go and process each three lines into one array record.
this works.
But I would like to make it more 'clean'.
How would I put a 'new line'/'line feed' at the en of each record, so I would have each record in it's own line in filestream?
Then this would be much easier to do, store and to load back in.
If anybody has any suggestions how to do this differently, please let me know.
Thanx a lot
Tilen
please help me with this one.
I have a 2 dimensional array I would like to store into filestream.
TRec = record
Id:integer;
Name:string;
Prop_id:integer;
end;
As I tried I could only save records into filestream as one by one in one go. So everything is in one line.
The problem is to reverse the process, to load records back into array. So I put 'delimiter' between data, like '&&&&&'.
So line wold be:
1&&&&&ABC&&&&&0&&&&&2&&&&&DEF&&&&&0&&&&&3&&&&&GHI&&&&&1
this line shows 3 records. And I would load data into TList and extract each data into one line, so I would have :
List[0]=1
List[1]=ABC
List[2]=0
List[3]=2
List[4]=DEF
List[5]=0
List[6]=3
List[7]=GHI
List[8]=1
then I would go and process each three lines into one array record.
this works.
But I would like to make it more 'clean'.
How would I put a 'new line'/'line feed' at the en of each record, so I would have each record in it's own line in filestream?
Then this would be much easier to do, store and to load back in.
If anybody has any suggestions how to do this differently, please let me know.
Thanx a lot
Tilen