🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.language.objectpascal
1 messages
1 total messages Started by Neil Joyce Wed, 07 Apr 2004 09:14
Is this a valid use of @
#152
Author: Neil Joyce
Date: Wed, 07 Apr 2004 09:14
41 lines
2399 bytes
Sorry for such a  basic question but I have been away from Delphi
pointers for a while. I have come up with the solution below to code
the contents held in the TListItems in  a TListView and have them
relate to data harvested elsewhere in the application.

This yields a "152:variable required"  error. How can I get this to
work; or can anyone suggest another way to link a TlistItem to the
strings in a TStringList another in a seperate list.


procedure TPeopleForm.UpdateContactsDisplay();
var
  i,orgs:integer;
  str:string;
  display_all,display_this_contact:boolean;
  PtrToContactNumber:^String;
begin
    display_all:=IncludeObsoletePeopleByOrgsCB.Checked;
    orgs:=ContactDbCentralDM.OrganizationNumbersSL.Count;
    PeopleByOrgsLV.Clear;
    for i:= 0 to orgs - 1 do
    begin
      display_this_contact:=False;
      if display_all then display_this_contact:=True
        else if ContactDbCentralDM.IsActiveContactSL.Strings[i]='T'
then
          display_this_contact:=True
            else display_this_contact:=False;
      if display_this_contact then begin
        str:=ContactDbCentralDM.OrganizationNamesSL.Strings[i];
        PeopleByOrgsLV.AddItem(str,nil);
        str:=ContactDbCentralDM.PositionTitlesSL.Strings[i];
        PeopleByOrgsLV.Items[i].SubItems.Add(str);

        //compiler says no to the following line
        PtrToContactNumber:=@ContactDbCentralDM.ContactNumbersSL.Strings[i];
        PeopleByOrgsLV.Items[i].Data:=PtrToContactNumber;
    end;
end;

I realise its probably that I am doing something dumb.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads