array with same value all the time?
- From: "Sonnich" <sonnich.jensen@xxxxxxxxxxxxxx>
- Date: 27 Mar 2006 07:52:18 -0800
Hi!
I have a project where I collect data into this:
TDataRec = record
Name: string[81];
RecordTime: TDateTime;
Value: double;
end;
I have an array ot that; where I add data when I get it (it happens in
a thread) - there is a TCristicalSection to avoid multiple instances
using it.
There is a procedure in the thread, which adds data.
The execute part looks at data, when there is enough, it goes in,
processes data, and delete them (that means - moving them, and setting
the array that much shorter using SetLenght) - usually it is cleared to
0 size.
{ delete used data }
i := iUsedData;
while i < Length(aData) do
begin
aData[i-iUsedData] := aData[i];
Inc(i);
end;
SetLength(aData, Length(aData) - iUsedData);
My problem is that sometimes for some reason, the Value is the same for
all records - that is possible, that it might happen once in a million
years, but not once a day as I get it. The name is the same, but the
timestamp is chaning correctly. It is just the recieved value, which
repeats itself.
BR
Sonnich
.
- Follow-Ups:
- Re: array with same value all the time?
- From: alanglloyd@xxxxxxx
- Re: array with same value all the time?
- From: Tom de Neef
- Re: array with same value all the time?
- Prev by Date: Re: Canon Printer SDK
- Next by Date: Re: how to install to multiple clients over a network?
- Previous by thread: Hourglass - screen.cursor or form.cursor?
- Next by thread: Re: array with same value all the time?
- Index(es):