title: Error with ToString Function Output
body: <p><strong>"Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another"</strong>. This is the run-time error message I receive when I try to run the code below. I am using a class, clsReceipt, to formulate a receipt in the form of a string so I can output it in a rich edit for the user to view before proceeding to purchase the products (an overview of sorts). I cannot find any errors and thus I need help. Please bear in mind I am a high school student and have a somewhat limited knowledge. I am using Delphi XE3 on Windows.</p>
  
  <p>Below is the code for btnPurchase:</p>
  
  <pre><code>procedure TfrmBuy.btnPurchaseClick(Sender: TObject);
  var
    i, n, itemNumber, quant : integer;
    found: boolean;
  begin
    repeat
      i := strtoint(inputbox('Purchase','Enter the number of items you wish to buy or enter 0              to cancel',''));
    until i&gt;=0;
    if i &lt;&gt; 0 then
    begin
      for n := 1 to i do
      begin
        found := false;
        repeat
          itemnumber := strtoint(inputbox('Item selection','Enter the Item number of purchase no. ' + inttostr(n),''));
          if dm.ADOtbl.Locate('Item number',itemnumber,[]) then
            found := true
          else
            showmessage('The item number you enteres was not found. Please try again.');
        until found = true;
        repeat
          quant := strtoint(inputbox('Quantity selection','Please enter the quantity of the item you wish to purchase','&gt;0'));
        until quant &gt;0;
        Myreciept := TReceipt.create(itemnumber,quant,n,i);
      end;
  
      richedit1.Lines.Clear;
      richedit1.Lines.Add(myreciept.tostring);
      btnCheckout.Visible := true;
      showmessage('Below is the reciept of your purchase. If you are satisfied, proceed to  checkoutby selecting "Confirm" or restart by selecting "Reset"');
    end;
    repeat
      i := strtoint(inputbox('Purchase','Enter the number of items you wish to buy or enter 0              to cancel',''));
    until i&gt;=0;
    if i &lt;&gt; 0 then
    begin
      for n := 1 to i do
      begin
        found := false;
        repeat
          itemnumber := strtoint(inputbox('Item selection','Enter the Item number of purchase no. ' + inttostr(n),''));
          if dm.ADOtbl.Locate('Item number',itemnumber,[]) then
            found := true
          else
            showmessage('The item number you enteres was not found. Please try again.');
        until found = true;
        repeat
          quant := strtoint(inputbox('Quantity selection','Please enter the quantity of the item you wish to purchase','&gt;0'));
        until quant &gt;0;
        Myreciept := TReceipt.create(itemnumber,quant,n,i);
      end;
  
      richedit1.Lines.Clear;
      richedit1.Lines.Add(myreciept.tostring);
      btnCheckout.Visible := true;
      showmessage('Below is the reciept of your purchase. If you are satisfied, proceed to  checkoutby selecting "Confirm" or restart by selecting "Reset"');
    end;
  end;
  </code></pre>
  
  <p>Below is the code for the ToString function in the class:</p>
  
  <pre><code>function TReceipt.ToString: string;
  var
  k:integer;
  begin
  result := '';
  result := 'Reciept' + #13 + '===============================================' + #13;
  result := result + 'Order ID: ' + fOrderID + #13;
  result := result + 'Item Name' + #9 + 'Quantity' + 'Cost' + #13;
  for k := 1 to length(arrItemNo) do
  begin
  dm.ADOtbl.RecNo := arritemno[k];
   result := result + dm.ADOtbl['Item Name'] + #9 + inttostr(arrQuantity[k]) + #9 +       floattostrf((arrQuantity[k] * dm.ADOtbl['Price'] ),ffcurrency,5,2) + #13;
  
  end;
  result := result + #13 + #13 + 'Subtotal: ' + floattostrf(getsubtotal,ffcurrency,5,2) +    #13;
  result := result + 'VAT: ' + floattostrf(getVat,ffcurrency,5,2) + #13;
  result := result + 'Grand Total: ' + floattostrf(ftotal,ffcurrency,5,2) + #13 +   '===============================================';
  
  
  end;
  end.
  </code></pre>
  
  <p>If anyone could assist me with solving this problem that would be great.</p>