<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Random number generation</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/random-number-generation/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/random-number-generation/</link>
	<description></description>
	<pubDate>Sat, 28 Nov 2009 10:51:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Mrdenny</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/random-number-generation/#comment-53288</link>
		<dc:creator>Mrdenny</dc:creator>
		<pubDate>Tue, 20 May 2008 00:30:33 +0000</pubDate>
		<guid isPermaLink="false">#comment-53288</guid>
		<description>I'm curious, what's the purpose behind this code?

Check out my SQL Server blog "[A href="http://itknowledgeexchange.techtarget.com/sql-server/"]SQL Server with Mr Denny[/A]" for more SQL Server information.</description>
		<content:encoded><![CDATA[<p>I&#8217;m curious, what&#8217;s the purpose behind this code?</p>
<p>Check out my SQL Server blog &#8220;<a href="http://itknowledgeexchange.techtarget.com/sql-server/">SQL Server with Mr Denny</a>&#8221; for more SQL Server information.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Willmage</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/random-number-generation/#comment-53282</link>
		<dc:creator>Willmage</dc:creator>
		<pubDate>Mon, 19 May 2008 17:29:58 +0000</pubDate>
		<guid isPermaLink="false">#comment-53282</guid>
		<description>The above answer will give you a random letter/number output, but it doesn't take into account the original number the user started with.  Here is an answer I have for this question:

Dim Letters, OrigNum
Dim TextNum, ID, TempHold
Dim RandNum, FinalAns

Letters = "abcdefghijklmnopqrstuvwxyz"
OrigNum = 123456

Randomize
Rem ** the following randomizes the original number
RandNum = ""
TextNum = Trim(Str(OrigNum))
For i = 1 To 5
    ID = Int((Len(TextNum) * Rnd) + 1)
    RandNum = RandNum &#38; Mid(TextNum, ID, 1)
    TempHold = Left(TextNum, ID - 1)
    TempHold = TempHold &#38; Mid(TextNum, ID + 1, Len(TextNum) - ID)
    TextNum = TempHold
Next
RandNum = RandNum &#38; TextNum
Rem ** the following creates your new random character/number string
FinalAns = ""
For i = 1 To 10
    If Len(FinalAns) + Len(RandNum) = 10 Then
        FinalAns = FinalAns &#38; Left(RandNum, 1)
        RandNum = Right(RandNum, Len(RandNum) - 1)
    Else
        If Len(RandNum) = 0 Then
            FinalAns = FinalAns &#38; Mid(Letters, Int(26 * Rnd) + 1, 1)
        Else
            If ((Int(Rnd * 2) + 1) Mod 2) &#60;&#62; 0 Then
                FinalAns = FinalAns &#38; Left(RandNum, 1)
                RandNum = Right(RandNum, Len(RandNum) - 1)
            Else
                FinalAns = FinalAns &#38; Mid(Letters, Int(26 * Rnd) + 1, 1)
            End If
        End If
    End If
Next

Hope that helps!</description>
		<content:encoded><![CDATA[<p>The above answer will give you a random letter/number output, but it doesn&#8217;t take into account the original number the user started with.  Here is an answer I have for this question:</p>
<p>Dim Letters, OrigNum<br />
Dim TextNum, ID, TempHold<br />
Dim RandNum, FinalAns</p>
<p>Letters = &#8220;abcdefghijklmnopqrstuvwxyz&#8221;<br />
OrigNum = 123456</p>
<p>Randomize<br />
Rem ** the following randomizes the original number<br />
RandNum = &#8220;&#8221;<br />
TextNum = Trim(Str(OrigNum))<br />
For i = 1 To 5<br />
    ID = Int((Len(TextNum) * Rnd) + 1)<br />
    RandNum = RandNum &amp; Mid(TextNum, ID, 1)<br />
    TempHold = Left(TextNum, ID - 1)<br />
    TempHold = TempHold &amp; Mid(TextNum, ID + 1, Len(TextNum) - ID)<br />
    TextNum = TempHold<br />
Next<br />
RandNum = RandNum &amp; TextNum<br />
Rem ** the following creates your new random character/number string<br />
FinalAns = &#8220;&#8221;<br />
For i = 1 To 10<br />
    If Len(FinalAns) + Len(RandNum) = 10 Then<br />
        FinalAns = FinalAns &amp; Left(RandNum, 1)<br />
        RandNum = Right(RandNum, Len(RandNum) - 1)<br />
    Else<br />
        If Len(RandNum) = 0 Then<br />
            FinalAns = FinalAns &amp; Mid(Letters, Int(26 * Rnd) + 1, 1)<br />
        Else<br />
            If ((Int(Rnd * 2) + 1) Mod 2) &lt;&gt; 0 Then<br />
                FinalAns = FinalAns &amp; Left(RandNum, 1)<br />
                RandNum = Right(RandNum, Len(RandNum) - 1)<br />
            Else<br />
                FinalAns = FinalAns &amp; Mid(Letters, Int(26 * Rnd) + 1, 1)<br />
            End If<br />
        End If<br />
    End If<br />
Next</p>
<p>Hope that helps!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- dynamic -->