Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

E2018 Record, object or class type required

Status
Not open for further replies.

fatlardo

Programmer
May 7, 2007
41
GB
I am trying to assign values to two properties of an object I have created. The relevant parts of the declaration are below:

type TTagv2 = record
//Variables used by unit
exists: Boolean;

//Frame variables
UFID: array of record //Unique file identifier
owner: string;
identifier: string;
end;
end;

There is more to the object but its far too long to post!!

The problem is, I get an error message (E2018 Record, object or class type required) when I try to compile the following code:

info.UFID.owner := LeftStr(strreadin, compos - 1);
info.UFID.identifier := RightStr(strreadin, Length(strreadin) - compos);

The error applies to both of these lines.

The strange thing is that I have another set of properties within the same object defined in exactly the same way and I can successfully use them exactly the same way and within the same function!!

Anyone have any ideas?

Gary
 
Ok, so it's just me being stupid!! I declared UFID as an array and forgot to specify the array element!! If anyone else has a similar problem, the correct code should be:

info.UFID.owner := LeftStr(strreadin, compos - 1);
info.UFID.identifier := RightStr(strreadin, Length(strreadin) - compos);

Sorry people!!!
 
To err is human. To really screw up requires a computer. - unknown
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top