|
-
Mar 8th, 2010, 11:09 PM
#1
Thread Starter
Junior Member
String Problem
I generated 10 integers in the array(9). Then I separate the array into two parts by using substring. But I just can't run the code, it has no error but cannot run. Is my code wrong???
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Randomize()
Dim rand As New Random
Dim array(9) As String
Dim X As String
Dim Y As String
array(0) = rand.Next
Dim HiOrder As String = array(0).Substring(0, 5)
Dim LoOrder As String = array(0).Substring(5, 5)
X = 1.3 + (HiOrder * ((2.4 - 1.3) / ((10 ^ 5) - 1)))
Y = 3.4 + (LoOrder * ((4.7 - 3.4) / ((10 ^ 5) - 1)))
ListBox1.Items.Add(HiOrder)
ListBox1.Items.Add(LoOrder)
ListBox1.Items.Add("X = " & X)
ListBox1.Items.Add("Y = " & Y)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|