mbt masai
 
Welcome !
         

                                
After experiencing a lot of down time, We decided to move this site to CrystalTech.com. CrystalTech.com is powered by only the finest Windows servers providing the best performance, reliability, and value anywhere.

 Core : Random serial generation ~good for labeling stuff.

Author Message
vbman

  • Total Posts : 8
  • Scores: 0
  • Reward points : 0
  • Joined: 8/22/2010
  • Status: offline
Core : Random serial generation ~good for labeling stuff. Sunday, August 22, 2010 7:27 PM (permalink)
0
I lost my last thread and not gonna do it again, but will answer your questions

PGDcode thing dont work for me right now.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dim array(61) , array2(20)
dim randomnumber
'just setting the arrays and stuff.

randomize
count=0
'Warming up random fuction and setting values

'here is the part were i just do it the easy way
'after thinking about it wouldnt it be easier to chr(randomNUM) and Ucase/Lcase?
'array 1 the setting of the ascii
'lower case start~
array(0)="a"
array(1)="b"
array(2)="c"
array(3)="d"
array(4)="e"
array(5)="f"
array(6)="g"
array(7)="h"
array(8)="i"
array(9)="j"
array(10)="k"
array(11)="l"
array(12)="m"
array(13)="n"
array(14)="o"
array(15)="p"
array(16)="q"
array(17)="r"
array(18)="s"
array(19)="t"
array(20)="u"
array(21)="v"
array(22)="w"
array(23)="x"
array(24)="y"
array(25)="z"

'numbers~
array(26)="1"
array(27)="2"
array(28)="3"
array(29)="4"
array(30)="5"
array(31)="6"
array(32)="7"
array(33)="8"
array(34)="9"
array(35)="0"

'upcase~
array(36)="A"
array(37)="B"
array(38)="C"
array(39)="D"
array(40)="E"
array(41)="F"
array(42)="G"
array(43)="H"
array(44)="I"
array(45)="J"
array(46)="K"
array(47)="L"
array(48)="M"
array(49)="N"
array(50)="O"
array(51)="P"
array(52)="Q"
array(53)="R"
array(54)="S"
array(55)="T"
array(56)="U"
array(57)="V"
array(58)="W"
array(59)="X"
array(60)="Y"
array(61)="Z"


'transfering random from array 1 to array 2
'vbs for loop, Would pay to see this simplyfied.

do until count=20
randomNumber=Int(61* Rnd())
array2(count) = array(randomnumber)
count=count+1
loop

'there has got to be a better way of doing this.
msgbox array2(1) & array2(2) & array2(3) & array2(4) & array2(5) & "-" & array2(6) & array2(7) & array2(8) & array2(9) & array2(10) & "-" & array2(11) & array2(12) & array2(13) & array2(14) & array2(15) & "-" & array2(16) & array2(17) & array2(18) & array2(19) & array2(20)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

quote me when using my code elsewhere.
would like to see what you have done with it as well.
#1
    ehvbs

    • Total Posts : 3312
    • Scores: 110
    • Reward points : 0
    • Joined: 6/22/2005
    • Location: Germany
    • Status: offline
    Re:Core : Random serial generation ~good for labeling stuff. Monday, August 23, 2010 2:03 AM (permalink)
    0
     '' randor.vbs - create random sequences
     '' !! http://www.visualbasicscript.com/How-to-organize-your-script-m82006.aspx
     
     Option Explicit
     
     '' Dispatch
     WScript.Quit pocMain()
     
     '' MAINS
     
     '' pocMain() - Proof Of Concept:
     ''                Using a string to specify the chars to use beats arrays
     ''                As the length of the sequence is known, a For loop can be
     ''                   used instead of a Do loop
     ''                Join() beats concatenation every time
     Function pocMain()
       pocMain = 1
       Randomize
       Dim nLenSeq  : nLenSeq  = 20
       Dim sUseChrs : sUseChrs = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
       Dim nUseChrs : nUseChrs = Len( sUseChrs )
       ReDim aSeq( nLenSeq - 1 )
       Dim nIdx
       For nIdx = 0 To UBound( aSeq )
           aSeq( nIdx ) = Mid( sUseChrs, 1 + Int( Rnd() * nUseChrs ), 1 )
       Next
       WScript.Echo "Random Sequence:", Join( aSeq, "" )
       pocMain = 0
     End Function '   pocMain
     


    As you offered payment for improvements, I ask you give (the equivalent of) $10
    to the first homeless person you meet (or post an argument, why you don't
    consider my proposal 'a better way of doing this').


    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.8
      mbt shoes www.wileywilson.com