Results 1 to 36 of 36

Thread: Algorithm to generate words

Threaded View

  1. #2
    Lively Member Arispan's Avatar
    Join Date
    Apr 2010
    Location
    Greece, Near Athens
    Posts
    98

    Re: Algorithm to generate words

    Hello,

    You can use this function:

    Code:
    Public Function GenerateStr()
    strInputString = txtInput.Text ' Change this textbox with your own
    intLength = Len(strInputString)
    intNameLength = Len(txtInput.Text)
    strName = ""
    For intStep = 1 To intNameLength
    intRnd = Int((intLength * Rnd) + 1)
    strName = strName & Mid$(strInputString, intRnd, 1)
    Next
    GenerateStr = strName
    End Function
    And then do something like this:

    Code:
    Private Sub Command1_Click()
    txtOutput.Text = GenerateStr ' Change this textbox with your own "output textbox"
    End Sub
    This will work

    EDIT: You can add this function inside module if you want.
    Last edited by Arispan; May 15th, 2010 at 11:06 AM.
    MOBO: Asrock X58 Extreme
    CPU : Core i7 950 @ 3.07Ghz
    Ram : 8GB
    Hard Drive : 1.5 TB (1 TB, 500GB)
    Graphics : ATI Radeon HD 5670
    Dual Boot : Windows XP Home, Windows 7 Ultimate x64


    _____________________
    If a reply has helped you, please consider rating it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width