<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Permutations</title><link>http://blogs.msdn.com/calvin_hsia/archive/2005/01/18/355405.aspx</link><description>I saw this post which shows some VFP code to permute a string. For example, there are 6 permutations of “abc”: abc, acb, bac, bca, cab, cba There are n! permutations of a string of length n. I dug up some old code that did the same thing in fewer lines.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Permutations</title><link>http://blogs.msdn.com/calvin_hsia/archive/2005/01/18/355405.aspx#362831</link><pubDate>Fri, 28 Jan 2005 23:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:362831</guid><dc:creator>Robert Hoogstraat</dc:creator><description>Here is another possible solution with little code:&lt;br&gt;&lt;br&gt;* PERMUTATIONS&lt;br&gt;*&lt;br&gt;* def'n:&lt;br&gt;*	If M = (n)P(r) = P(n):(r) denotes the number of&lt;br&gt;* permutations of (n) distinct things taken (r) at a time,&lt;br&gt;* -- M = n(n-1)(n-2)...(n-r+1) = n!/(n-r)!&lt;br&gt;&lt;br&gt;Permutations( &amp;quot;12345&amp;quot; )&lt;br&gt;&lt;br&gt;PROCEDURE Permutations ;&lt;br&gt;( ;&lt;br&gt;	tvThings	AS CHARACTER, ;&lt;br&gt;	tvStatic	AS CHARACTER, ;&lt;br&gt;	tvN		AS INTEGER ;&lt;br&gt;) AS VOID&lt;br&gt;	LOCAL iX AS INTEGER&lt;br&gt;	IF VARTYPE(tvStatic)=&amp;quot;L&amp;quot;&lt;br&gt;	* First time procedure called, preset missing parameters.&lt;br&gt;		CLEAR&lt;br&gt;		PUBLIC lnPermutation AS INTEGER&lt;br&gt;		lnPermutation	= 0&lt;br&gt;		tvStatic		= &amp;quot;&amp;quot;&lt;br&gt;		tvN				= LEN(tvThings)&lt;br&gt;	ENDIF&lt;br&gt;	FOR iX = 1 TO tvN&lt;br&gt;		IF tvN &amp;gt; 2&lt;br&gt;			Permutations( RIGHT( tvThings, tvN-1 ), tvStatic+LEFT(tvThings,1), tvN-1 )&lt;br&gt;		ELSE&lt;br&gt;			lnPermutation = lnPermutation + 1&lt;br&gt;			? lnPermutation, tvStatic+tvThings&lt;br&gt;		ENDIF&lt;br&gt;		tvThings = SUBSTR(tvThings,2) + LEFT(tvThings,1)&lt;br&gt;	ENDFOR&lt;br&gt;ENDPROC&lt;br&gt;</description></item><item><title>Good site</title><link>http://blogs.msdn.com/calvin_hsia/archive/2005/01/18/355405.aspx#7213946</link><pubDate>Thu, 24 Jan 2008 04:20:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7213946</guid><dc:creator>Vilyamdn</dc:creator><description>&lt;p&gt;&amp;lt;a href= &lt;a rel="nofollow" target="_new" href="http://index1.morun5.com"&gt;http://index1.morun5.com&lt;/a&gt; &amp;gt;boy scout camp forestburg&amp;lt;/a&amp;gt; &lt;/p&gt;
</description></item></channel></rss>