How do I get all the username values from the image below and can convert them into TStringList, strings or TMemo?

I tried the following code but it didn't work.
with q3 do
  var txResul:stringlist
  begin
    Close;
    SQL.Clear;
    SQL.Add('SELECT*FROM user');
    Open;
    Next;
  end;
  txtResult.Add(q1.FieldByName('username').AsString);
				
                        
Assuming your screenshot is a dataset you call do something like this:
You might use it like this
Btw, if you changed the second parameter of GetUserNames to a TStrings, as in
GetUserNames(DataSet : TDataSet; Strings : TStrings)you could pass Memo1.Lines to it directly.