scripting@wanadoo.nl




JoinRev()

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
9 January 2002 JoinRev()
AuthorScriptLogic Corporation
Action Combine the elements from an array (in reverse order) into a single, concatenated string.
SyntaxJoinRev (Array, Delimiter, Count) 
Parameters
  • Array (Required / Array) The array containing the elements to combine.
  • Delimiter (Optional / String) String character(s) to insert between the elements of the array when combining them into the return string.
  • Count (Optional / Numeric) Maximum element of the array to concatenate to the string. If not specified, all elements of the array will be combined into the return string. 
  • RemarksCompliments the Join() UDF. 
    ReturnsReturns a single string built by concatenating the elements of the array, in reverse order. 
    DependenciesNone. 
    Examples
    $MyArray='red','orange','yellow','green','blue'
    ?'No Delim: '+JoinRev($MyArray)
    ?'Space Delim: '+JoinRev($MyArray,' ')
    ?'Tilde Delim, limited to elements (0-2): '+JoinRev($MyArray,'~',2)
    
     
    Source
    FUNCTION JoinRev ($array, OPTIONAL $delimiter, OPTIONAL $maxcount)
      DIM $count, $index
      IF VarType($delimiter) = 0 ; not passed
        $delimiter=''
      ENDIF
      IF VarType($maxcount) = 0 ; not passed
        $maxcount=UBound($array)
      ENDIF
    
      $joinrev=''
      $count=0
      FOR $index=$maxcount TO 0 STEP -1
        IF ($count <= $maxcount)
          $joinrev=$joinrev+$array[$index]+$delimiter
        ENDIF
        $count=$count+1
      NEXT
      $joinrev=Left($joinrev,Len($joinrev)-Len($delimiter))
    ENDFUNCTION ; - JoinRev -
     
      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