Wrox Programmer Forums
|
Visual Basic 2008 Professionals For advanced Visual Basic coders working in version 2008. Beginning-level questions will be redirected to other forums,
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2008 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 3rd, 2010, 11:56 PM
Registered User
 
Join Date: Mar 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to stevereimo
Default Loop And Arrays

Hello fellow programmers i have an issue with a program that i try to create a program that it will draw some data from an array with 10 numbers and a loop that it will place to the user a bigger number that a user will place in an inputtextbox. any suggestion?
 
Old March 4th, 2010, 03:08 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

Can you please be more specific. It would be good if you can post your code snippet here

Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
 
Old March 4th, 2010, 10:17 AM
Registered User
 
Join Date: Mar 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to stevereimo
Default

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myarray(10) As String
myarray(1) = 6124
myarray(2) = 34
myarray(3) = 12
myarray(4) = 456
myarray(5) = 21234
myarray(6) = 45
myarray(7) = 6623
myarray(8) = 6654
myarray(9) = 72
myarray(10) = 38



Dim times As Integer
Dim StoreAnswer As Integer
Dim i As Integer

Label1.Text = ""


times = Val(TextBox1.Text)

For i = 1 To 10

StoreAnswer = myarray(1) * times
myarray(i) = StoreAnswer
Label1.Text = (times & "" & i & "" & myarray(i))

Next i
End Sub



End Class

this is the code of mine and i would like to change the multiplication part and to replace it with a script that it will return the biggest num in the array (for example if the user input 2 the array must return 4).

Last edited by stevereimo; March 4th, 2010 at 12:59 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
arrays Moharo PHP How-To 2 April 7th, 2016 01:16 PM
Loop twice, then inside loop select nodes?? JohnBampton XSLT 2 March 9th, 2009 05:21 AM
Multidemmesional Arrays OR arrays gmoney060 Classic ASP Basics 3 November 1st, 2004 03:42 PM
nested while loop doesn't loop hosefo81 PHP Databases 5 November 12th, 2003 08:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.