Recent

Author Topic: Function to get string containing the same letter added multiple times?  (Read 5426 times)

krexon

  • Jr. Member
  • **
  • Posts: 80
I forgot the name of function to build string with the letter added "n" times..
Instead of loop: for i:=0 to n do s:=s+'a' I want use: function('a', n), where n means how many times to add letter.

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2706
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

krexon

  • Jr. Member
  • **
  • Posts: 80
Thx Marc. I forgot the name of that function :)


Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2706
FillChar is not exactly the same. StringOfChar() allocates the sting and fills it, while FillChar() only fills a buffer (which you have to allocate first)
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018