home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / TPBASIC.ZIP / REPSTR.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1985-02-26  |  1.3 KB  |  38 lines

  1. Function Rep_String ( Length : String_Length ;
  2.                       CH     : Char            ) : Field_String ;
  3.  
  4.     (*
  5.         This function is similar to the STRING$ function in MS-BASIC.
  6.         It will return a string of length LENGTH filled with the
  7.         character CH.
  8.  
  9.         LENGTH must be in the range 1..255.  If it is not, an empty
  10.         string will be returned.
  11.  
  12.         This function was written by Paul D. Guest and released
  13.         to the Public Domain by same without restrictions on use,
  14.         and with no monetary return expected or desired.  Please
  15.         direct comments or questions to the author via "The Indy
  16.         Connection" RBBS @ (317) 846-8675 (24 hrs,7 days/week --
  17.         Paul & Greg McLear, sysops).
  18.         (Enjoy! - pdg 2/85)
  19.  
  20.     *)
  21.  
  22. Var
  23.     Count     : Integer ;       (* Number of 'CH' placed in 'CH_String' *)
  24.     CH_String : Field_String ;  (* String containing 'CH' Characters    *)
  25.  
  26. Begin (* Function Rep_String *)
  27.  
  28.     CH_String := '' ;
  29.  
  30.     If Length IN [ 1 .. 255 ] Then
  31.  
  32.         For Count := 1 to Length Do
  33.             CH_String := CONCAT ( CH_String , CH ) ;
  34.  
  35.     Rep_String := CH_String
  36.  
  37. End (* Function Rep_String *) ;
  38.