place a in a textbox - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

place a in a textbox

robokoprobokop Posts: 11Member
I made a code in VB 6.0 to generate a string with some random values
i have a text1 textbox element and a key Command1
this is the script of what happens after the click on the button

Private Sub Command1_Click()
Dim lijst(1 To 128) As Integer
Dim lopendevar As Integer
Dim pendevar As Integer
Dim opendevar As Integer
Dim random As Integer
Dim check As Boolean
Text1.Text = ""
For opendevar = 1 To 15
Randomize
random = Round(Rnd * 256 + 1)
For lopendevar = 1 To 128
lijst(lopendevar) = random
Randomize
random = Round(Rnd * 256 + 1)
check = True
Do Until check = False
check = False
For pendevar = 1 To lopendevar
If random = lijst(lopendevar) Then
check = True
End If
Next
If check = True Then
Randomize
random = Round(Rnd * 256 + 1)
End If
Loop
Next
For lopendevar = 1 To 128
Text1.Text = Text1.Text & "codealgorithmmatrix[" & opendevar & "," & lopendevar & "] := " & lijst(lopendevar) & "; "
Next
Next
End Sub

and after every ";" i want to place an

Comments

  • iwilld0itiwilld0it Posts: 1,134Member
    [b][red]This message was edited by iwilld0it at 2004-12-30 7:37:14[/red][/b][hr]
    : I made a code in VB 6.0 to generate a string with some random values
    : i have a text1 textbox element and a key Command1
    : this is the script of what happens after the click on the button
    :
    : Private Sub Command1_Click()
    : Dim lijst(1 To 128) As Integer
    : Dim lopendevar As Integer
    : Dim pendevar As Integer
    : Dim opendevar As Integer
    : Dim random As Integer
    : Dim check As Boolean
    : Text1.Text = ""
    : For opendevar = 1 To 15
    : Randomize
    : random = Round(Rnd * 256 + 1)
    : For lopendevar = 1 To 128
    : lijst(lopendevar) = random
    : Randomize
    : random = Round(Rnd * 256 + 1)
    : check = True
    : Do Until check = False
    : check = False
    : For pendevar = 1 To lopendevar
    : If random = lijst(lopendevar) Then
    : check = True
    : End If
    : Next
    : If check = True Then
    : Randomize
    : random = Round(Rnd * 256 + 1)
    : End If
    : Loop
    : Next
    : For lopendevar = 1 To 128
    : Text1.Text = Text1.Text & "codealgorithmmatrix[" & opendevar & "," & lopendevar & "] := " & lijst(lopendevar) & "; "
    : Next
    : Next
    : End Sub
    :
    : and after every ";" i want to place an
    :

    vbCrLf ()

    [code]
    strValue & vbCrLf
    [/code]


  • robokoprobokop Posts: 11Member
    : [b][red]This message was edited by iwilld0it at 2004-12-30 7:37:14[/red][/b][hr]
    : : I made a code in VB 6.0 to generate a string with some random values
    : : i have a text1 textbox element and a key Command1
    : : this is the script of what happens after the click on the button
    : :
    : : [code]Private Sub Command1_Click()
    : : Dim lijst(1 To 128) As Integer
    : : Dim lopendevar As Integer
    : : Dim pendevar As Integer
    : : Dim opendevar As Integer
    : : Dim random As Integer
    : : Dim check As Boolean
    : : Text1.Text = ""
    : : For opendevar = 1 To 15
    : : Randomize
    : : random = Round(Rnd * 256 + 1)
    : : For lopendevar = 1 To 128
    : : lijst(lopendevar) = random
    : : Randomize
    : : random = Round(Rnd * 256 + 1)
    : : check = True
    : : Do Until check = False
    : : check = False
    : : For pendevar = 1 To lopendevar
    : : If random = lijst(lopendevar) Then
    : : check = True
    : : End If
    : : Next
    : : If check = True Then
    : : Randomize
    : : random = Round(Rnd * 256 + 1)
    : : End If
    : : Loop
    : : Next
    : : For lopendevar = 1 To 128
    : : Text1.Text = Text1.Text & "codealgorithmmatrix[" & opendevar & "," & lopendevar & "] := " & lijst(lopendevar) & "; "
    : : Next
    : : Next
    : : End Sub[/code]
    : :
    : : and after every ";" i want to place an
    : :
    :
    : vbCrLf ()
    :
    : [code]
    : strValue & vbCrLf
    : [/code]
    :
    :
    :
    thank you
Sign In or Register to comment.