TEdit -> lbxListBox2 -> TMemo lazarus / 31-LCL ---------------------------------------------------------------------- kogs · 2015-08-10 09:35 1. edtEdit2 - yes 2. lbxListBox2 - yes 3. mmoMemo2 - no - ? Quoteprocedure TfrmMain.edtEdit2Change(Sender: TObject); var   i, j, k: Integer;   stringCaller, stringEDIT2: String;   boolCheckBox: Boolean; begin   lbxListBox2.Items.Clear;   if edtEdit2.Text = '' then   begin     Exit;   end;   boolCheckBox := cbxCheckBox2.Checked;   i :=  Length(edtEdit2.Text);   stringEDIT2 := UpperCase(edtEdit2.Text);   if boolCheckBox = True then   begin     for k := 0 to i do     begin       case stringEDIT2[k] of         'A', 'E', 'I', 'O', 'U': stringEDIT2[k] := 'Y';       end;     end;   end;   for j := 0 to clrCaller.Count - 1 do   begin     if TNodeCaller(clrCaller.Objects[j]).OK <> False then     begin       stringCaller := UpperCase(clrCaller.Strings[j]);       if boolCheckBox = True then       begin         for k := 0 to i do         begin           case stringCaller[k] of             'A', 'E', 'I', 'O', 'U': stringCaller[k] := 'Y';           end;         end;       end;       if stringEDIT2 = LeftStr(stringCaller, i) then       begin         lbxListBox2.Items.AddObject(clrCaller.Strings[j], TNodeCaller(clrCaller.Objects[j]));       end;     end;   end; end;  Quoteprocedure TfrmMain.lbxListBox2Click(Sender: TObject); begin   mmoMemo2.Lines.Clear;   mmoMemo2.Lines.Add(TNodeCaller(lbxListBox2.Items.Objects[lbxListBox2 .ItemIndex]).Dict); end;         kogs ---------------------------------------------------------------------- howardpc · 2015-08-10 10:02 I think you will have to share your implementation of the TNodeCaller class for us to be helpful. ---------------------------------------------------------------------- derek.john.evans · 2015-08-10 10:21 Two issues I can see. 1) Strings start at index 1. Not 0. 2) You set the string variable stringCaller from clrCaller.Strings[j], but then you iterate that string based on the length of edtEdit2.Text. TIP: Dont cache the length of a string. In Pascal, the range of a for loop is only evaluated once. ie: for I := 1 to Length(S) do SomeThing; // << The Length is only evaluated once, so speed is ok. ---------------------------------------------------------------------- kogs · 2015-08-10 13:19 Code: [Select]  TNodeCaller = class   private     fId: Integer;     fName: String;     fNameId, fOK: Boolean;     fDict: String;     fCallerId: Integer;     fBool: Boolean;   public     constructor Create(Id: Integer; Name: String; NameId, OK: Boolean; Dict: String;       CallerId: Integer; Bool: Boolean);     property Id: Integer read fId write fId;     property Name: String read fName write fName;     property NameId: Boolean read fNameId write fNameId;     property OK: Boolean read fOK write fOK;     property Dict: String read fDict write fDict;     property CallerId: Integer read fCallerId write fCallerId;     property Bool: Boolean read fBool write fBool;   end;    Code: [Select]  TclrStringList = class(TStringList)   private   public     function AddObjectCallerAndSQL(SQLQueryA: TSQLQuery): TNodeCaller;     function AddObjectCaller(intId: Integer; stringName: String; intNameId,       intOK: Integer; stringDict: String; intCallerId: Integer; Bool: Boolean):       TNodeCaller;   end;                  TfrmMain -> clrCaller: TclrStringList; Code: [Select]    while not EOF do     begin       // clrCaller -> SQLQuery1       NodeCaller := clrCaller.AddObjectCallerAndSQL(SQLQuery1);      ...                                                                                                                            kogs ---------------------------------------------------------------------- derek.john.evans · 2015-08-10 13:34 I dont know what the question is? PsnnCall3.pdf shows that some text is being put into the TMemo. But, you have a red circle indicating that its incorrect. This code indicates that that text came from the property TNodeCaller.Dict TNodeCaller(lbxListBox2.Items.Objects[lbxListBox2.ItemIndex]).Dict And, Dict is a string. Thats about the extent of the information I see. Not enough input I'd say. ---------------------------------------------------------------------- derek.john.evans · 2015-08-10 13:43 It looks like you are writing a table lookup feature which shows a record field in a TMemo. There are far easier ways todo this. TListView can store tables (fields stored in SubItems), which includes the method: Code: [Select]function TListView.FindCaption(StartIndex: Integer; Value: string; Partial, Inclusive,   Wrap: Boolean; PartStart: Boolean = True): TListItem;  Or, you can use a TBufDataset->TDataSource->(TDBGrid/TDBMemo) design. TBufDataset has some great Filter features for searching. ---------------------------------------------------------------------- kogs · 2015-08-10 16:17 (Aphasia - http://en.wikipedia.org/wiki/Aphasia) 1. edtEdit2.Text -> OnChange -> lbxListBox2.Items.AddObject(clrCaller.Strings[j], TNodeCaller(clrCaller.Objects[j])) - yes    edtEdit2 - OK lbxListBox2 - OK                2. OnClick -> mmoMemo2.Lines.Clear -> mmoMemo2.Lines.Add(TNodeCaller(l bxListBox2.Items.Objects[lbxListBox2.ItemIndex]).Dict); mmoMemo2 - no mmoMemo2 - no -> PsnnCall3.pdf kogs