Opened 10 years ago

Closed 10 years ago

#2561 closed Feature Request (Rejected)

UDF - _ArrayPermute - proposal

Reported by: mlipok Owned by:
Milestone: Component: Standard UDFs
Version: Severity: None
Keywords: Cc:



Func _ArrayPermute(ByRef $avArray, $sDelim = "")
	If Not IsArray($avArray) Then Return SetError(1, 0, 0)
	If UBound($avArray, 0) <> 1 Then Return SetError(2, 0, 0)
	Local $iSize = UBound($avArray), $iFactorial = 1, $aIdx[$iSize], $aResult[1], $iCount = 1

	If UBound($avArray) Then
		For $i = 0 To $iSize - 1
			$aIdx[$i] = $i
		For $i = $iSize To 1 Step -1
			$iFactorial *= $i
		ReDim $aResult[$iFactorial + 1]
		$aResult[0] = $iFactorial
		__Array_ExeterInternal($avArray, 0, $iSize, $sDelim, $aIdx, $aResult, $iCount)
		$aResult[0] = 0
	Return $aResult
EndFunc   ;==>_ArrayPermute


If UBound($avArray) Then


If $iSize Then

because: faster and cleaner

Attachments (0)

Change History (4)

comment:1 Changed 10 years ago by Jos

Have you actually tested this and have proof as I believe the evaluation in the For statement is only done one time at its start so Ubound() is only done one time?


comment:2 Changed 10 years ago by TicketCleanup

  • Version Other deleted

Automatic ticket cleanup.

comment:3 Changed 10 years ago by mlipok

I have a few solutions that operate very strongly, with variables of type array.
The script is running slowly because a lot of data processing.
I can not identify changes in performance.
Overall, I look at the features available, and looking for possible improvements.

In this case, I think I was a little gone too far.

comment:4 Changed 10 years ago by Jos

  • Resolution set to Rejected
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.