scripting@wanadoo.nl




Repeat()

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
12 February 2002 Repeat()
AuthorW.M. Hinsch (New Mexico Mark)
Action Returns a string composed of specified character(s) repeated n times.
SyntaxRepeat (String, Integer) 
Parameters
  • String (Required / String) One or more characters to repeat.
  • Integer (Required / String) a positive integer between 0 and 31999. 
  • RemarksThis is a quick way to repeat a character an exact number of times. The function may yield unpredictable results with some characters (like "@"). However, it will handle ASCII 31 - 126 with no problems. It will also handle some unusual characters like BELL (ASCII 7). 
    ReturnsA string containing the provided character repeated n times. 
    DependenciesNone. 
    Examples
    Repeat("<*>",26) ?
    Repeat("*",79) ?
    Repeat("Hi There ",8) ?
    Repeat("*ABC123* ",8) ?
    Repeat("Hello ",32000) ?
    Repeat("Test ",16) ?
    
    Repeat("   |||| ",10) ?
    Repeat("  " + Repeat("(o)",2),10) ?
    Repeat("     >  ",10) ?
    Repeat("   \___/",10) ?
    
    ; Console displays
    
    ;<*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*>
    ;*******************************************************************************
    ;Hi There Hi There Hi There Hi There Hi There Hi There Hi There Hi There
    ;*ABC123* *ABC123* *ABC123* *ABC123* *ABC123* *ABC123* *ABC123* *ABC123*
    
    ;Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
    
    ;   ||||    ||||    ||||    ||||    ||||    ||||    ||||    ||||    ||||    ||||
    ;  (o)(o)  (o)(o)  (o)(o)  (o)(o)  (o)(o)  (o)(o)  (o)(o)  (o)(o)  (o)(o)  (o)(o)
    ;     >       >       >       >       >       >       >       >       >       >
    ;   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/
    
     
    Source
    FUNCTION Repeat ($str, $int)
      ;Syntax: Repeat(String, Integer)
      ;String = ASCII string
      ;Integer = Positive integer
    
      DIM $i
      $str=''+$str
      $int=0+$int
      IF ($int >= 0) AND ($int <= 32000/Len($str)) AND ($str <> '')
        FOR $i = 1 TO $int
          $repeat=$repeat+$str
        NEXT
      ELSE
        $repeat=''
      ENDIF
    ENDFUNCTION ; - Repeat -
     
      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