First apologies. I typed this late last night and apparently deleted a few sentences, meaning to edit, before posting...Then I didn't put back the important part
. This part isn't in my title either so I definitel need to stay away from late night posting.
I'm looking for a way to use the embedded record/class as a List. I found this:
https://forum.lazarus.freepascal.org/index.php/topic,30764.0.html. It's a general direction but goes to a specific place which isn't helpful to my requirement.
So, I'd like a pattern/suggestion for creating a List of records (or a list of objects) within a class.
I've tried things like:
interface
uses
Classes, SysUtils, Math, fgl;
type
TCurvePointListRecord = Record
iNum : integer;
X : double;
Y : double;
Date_Time : TDateTime;
end;
type
TWvLngthCurve = Class
const
CURVE_1 : integer = 0;
CURVE_2 : integer = 1;
CURVE_3 : integer = 2;
CURVE_4 : integer = 3;
public
WvToTrack : integer;
WvMin : integer;
WvMax : integer;
WvMinAlarm : integer;
WvMaxAlarm : integer;
WvNumber : integer;
WvActive : boolean;
ThisYHigh : boolean;
ThisYLow : boolean;
Num : integer;
PCurvePointListRecord : ^TCurvePointListRecord;
TCurvePointList : specialize TFPGObjectList<PCurvePointListRecord>;
public
constructor Init(CurveNumber : integer);
procedure InitWvValues(CurveNumber : integer);
procedure LoadVarsFromDB(CurveNumber : integer ; DBString : string);
function ConvertStringToBool(inStr : string) : boolean;
procedure FindNewY(var NewY : currency ; AvgArray : array of double);
procedure CleanUpOnClose();
procedure ListClear();
end;
implementation
uses
WavelengthAvgRuntime;
var
CurvePointList : TCurvePointList;
constructor TWvLngthCurve.Init(CurveNumber : integer);
begin
InitWvValues(CurveNumber);
end;
This fails to compile at line 38 (as above) with: wvlngthcurveunit.pas(42,51) Error: Identifier not found "PCurvePointListRecord".
I've moved this line around some and it always seem to have some sort of compile issue with it.
(Note that I've updated the subject line here to make it consistent with the body.)
Thanks.