title: How to convert words into a sentence?
body: <p>I must ask the user to enter words (one at a time), until "xxx" is entered. I must then build a sentence with those words with one space between each word. The sentence must be displayed as soon as the terminating string ("xxx") is entered.</p>
  
  <p>My code only displays "xxx", the terminating code.</p>
  
  <p>Note: We haven't started with Arrays yet.</p>
  
  <p>This is the code I tried so far:</p>
  
  <pre><code>unit BuildSentence_U;
  
  interface
  
  uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls, ComCtrls;
  
  type
    TForm1 = class(TForm)
    btnResult: TButton;
  redOut: TRichEdit;
  procedure btnResultClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
  
  var
    Form1: TForm1;
  
  implementation
  
  {$R *.dfm}
  
  procedure TForm1.btnResultClick(Sender: TObject);
  Var wrd : string;
  begin
  
  wrd := inputbox('Word input', ' Enter any word to build a sentence     (press "xxx" to stop)','');
  redOut.Clear;
  
  while (wrd &lt;&gt; 'xxx') do
   begin
    wrd := wrd + ' ';
    wrd := inputbox('Word input', ' Enter any word to build a sentence (press"xxx" to stop)','');
   end;
  redOut.Lines.Add(wrd);
  end;
  
  end.
  </code></pre>