scripting@wanadoo.nl




RepeatStr()

http://www.scriptlogic.com/kixtart/FunctionLibrary_FunctionList.aspx


actual FunctionLibrary list on 'Scriptlogic' site printer-friendly mirror of UDF topic on 'scripting@wanadoo.nl' site close
31 May 2002 RepeatStr()
AuthorLee Wilmott
Action Repeats a given string a specified number of times.
SyntaxRepeatStr ("stringtorepeat", "numberoftimes") 
Parameters
  • stringtorepeat (Required / String) A string of any length that is to be repeated.
  • numberoftimes (Required / String) Specifies the number of times which the specified string should be repeated. 
  • RemarksI know this function is really, really simple. But it is a function I use a great deal for formatting and underlining text.
    I was hoping that if enough people like it that one day it would be added to Kix natively. 
    ReturnsA string containing the passed string repeated a specified number of times.. 
    DependenciesNone. 
    Examples
    ? "'" + RepeatStr(" ", 3) + "'"
    ;output '   '
    
    ? "'" + RepeatStr(" ", 0) + "'"
    ;output ''
    
    ? "'" + RepeatStr("-", 5) + "'"
    ;output '-----'
    
    ? "'" + RepeatStr("abc", 2) + "'"
    ;output 'abcabc'
    
     
    Source
    FUNCTION RepeatStr ($stringtorepeat, $numoftimes)
      ;This function repeats a string a specified number of times
    
      DIM $counter
      $repeatstr=""
      IF VarType($stringtorepeat) = 8
        FOR $counter = 1 TO $numoftimes
          $repeatstr=$repeatstr+$stringtorepeat
        NEXT
      ENDIF
    ENDFUNCTION ; - RepeatStr -
     
      original source of UDF topic. show actual FunctionLibrary list on Scriptlogic site close top
              printer-friendly mirror of UDF topic on scripting@wanadoo.nl site  




    Copyright © 2003 www.scriptlogic.com & scripting@wanadoo.nl - last updated on 20 May 2003


    Site Meter