I want to find which of the 64 elements has the highest number and which of the 64 elements has the lowest number?Is there a new command in vb10 to do this quick with little code?
I have ten numbers like 1.1,2.5,3.7,4.9,5.4,6.2,7.6,8.9,9.0,3.56
How I can find the largest number in the group?? I can do comparison of two number and repeat the process but it is very long, is there any other ways??
Am using VB 2005 and need to take an existing txt file which basically has 15 sets of data, each set containing a year (ie Year 1990) and a number below the year.
When a user clicks the calculate button on a form, I need it to first list the average of all those numbers in the txt. And below that I need the largest number in the file to be displayed.
I am basically familiar with using objReader and StreamReader. But, I can only verify and open the text.
I am creating a sailing score points program and want to create something like: what TEXTBOX has got biggest number that is between (TEXTBOX IS BETWEEN NOT THE NUMBER) [ and ] And it's subtracts that number what is in that box from the textbox3 when possible then how to do like:
under textbox are four checkboxes Named: DNS, DNF, DSQ and OCS and they give so much points how many are the sailers + 1. The setting name is Sailers
Getting largest and smallest number from an array and placing in 2 dif Posted 02 November 2010 - 05:34 PM I have the code written for everything except when I try to display the highest and smallest numbers from the array into a label it display 0 for both the smallest and highest number.Question: Create an application that lets the user enter 10 values into an array. The application should display the largest and smallest values stored in the array.
*The form is a list box with 2 labels and a button to retrieve the 10 numbers and put them in the list box then the other button puts the highest and lowest number in the 2 labels
Note: Place them in 2 diff sub-routines.
Option Strict Off Option Explicit On Public Class Form1
[code]....
The only issue i have is to get the smallest number to show up.. mine just keeps showing "Zero".
I have the code written for everything except when I try to display the highest and smallest numbers from the array into a label it display 0 for both the smallest and highest number. Question: Create an application that lets the user enter 10 values into an array. The application should display the largest and smallest values stored in the array. *The form is a list box with 2 labels and a button to retrieve the 10 numbers and put them in the list box then the other button puts the highest and lowest number in the 2 labels
(I am not sure how to display line numbers in my code on VB2010, please if you know tell me and I will edit the post)
I am learning Linq, so bear with me. I have a class object that holds 4 other class objects with each holding a List(Of T) of the next. Think tiered classes. As these lists as built I need to search all the Group2 for all Group3 to see which Group3.units.count is the largest. "units" being a List(Of T). [code]
I have 2 labels. One needs to show me the lowest number of the 10 in my rich text box and the other needs to show me the largest.
Public Class Form1 Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub [Code] .....
Am using VB 2005 and need to take an existing txt file which basically has 15 sets of data, each set containing a year (ie Year 1990) and a number below the year.When a user clicks the calculate button on a form, I need it to first list the average of all those numbers(not year) in the txt. And below that I need the largest number in the file to be displayed
I have stores some numbers as strings and also some non-numbers as strings in an array. How do I find and store the numbers in one array and non numbers in another array?
I'm using Streamwriter/Streamreader for the first time in this project and keep getting an "Argument out of Range Exception was unhandled" error.It says "length cannot be less than zero. Parameter name: length."This happens at "dblYearly Income." Also, how do I find out the number of occurrences of an item in an array? For instance, I have a Race combobox and need to find out how many occurrences there are for each race.Also, is there a way to count the number of occurrences of an array itself, I guess the upper index value? [code]
My datagrid view looks like this :When I put the table to fill in word,my report looks like the table below, but I want my rank days are arranged from smallest to largest as in the table below :
Cod for filling
in the table word I use this:
Dim Tabela3 As Word.Table = WordDoc.Tables.Add(WordDoc.Bookmarks.Item("endofdoc").Range, DataGridView2.RowCount, 6) Tabela3.Range.ParagraphFormat.SpaceAfter = 0 Tabela3.Columns.Item(1).Width = WordApp.MillimetersToPoints(33.3)
i'm having problems creating a simple button for a programme which finds the largest word in an array and puts it into a textbox. I've done most of the coding (I hope) was wondering if somebody could help me actually with the code that finds the largest text in the array as I am struggling the most with that.
Private Sub btnLongName_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLongName.Click Dim LongName As String Dim LengthOfLongestName As Integer
[wink]You'll notice i dim'd n as integer = 0...[/wink] hehe I need a bit of advice on how to find the largest number stored as data in an array. For example vote(0) = 6, and vote(3) = 12, and lets assume all the other vote(n) are less. How do I pick out the big one?
I have an array of integers and I need to know the index of the largest number (not the actual value, just the index of whichever is highest).
However, if one or more indexes "tie" for the highest value, I need to have all of the indexes that share that high value.
I assume this function would need to return an array (since it could be one or more indexes), but I am not totally sure how to go about getting the more efficient solution.
What I am trying to do is fill an array from the largest index to the smallest index -- with the desired effect of reversing the values in the array. I have been looking at doing it with 2 for...next loops and I thought I had it, but I don't. As the reversed array is empty at the end of the 2 for...next loops here is code that I have been playing around with.
Dim myIntArray() As Integer ReDim Preserve myIntArray(4) myIntArray(0) = 0 myIntArray(1) = 1 myIntArray(2) = 2 [Code] .....
I create an array of this and load different distances into the ProjectileDistance property of the array. My question is this: How do i sort this array from smallest to largest value of ProjectileDistance?
I am trying to program a noise reduction algorithm that works with a set of datapoints in a VB.NET DataTable after being helped with my other question. Basically, I want to take two integers, a coordinate value (yCoord for example) and a threshold smoothing value (NoiseThresh), and take the average of the values in the range of (yCoord - NoiseThresh, yCoord + NoiseThresh) and store that number into an array. I'd repeat that process for each column (in this example) and end up with a one-dimensional array of average values. My questions are:
1) Did anything I just say make any sense ;), and
2) Can anyone help me with the code? I've got very little experience working with databases.
I have a problem with a sql query. Through the query I am trying to search database for any occurrences of string (can be anything) in a column using the SQL LIKE command. The problem is that it works fine for most of the strings say john, jim, ji"m , but does not work when i include the following characters which are ( ' , { , } , and a single quotation mark). MYSQL query takes care of these special cases by putting them in [] block whenever user enters them .But i am getting the following error when i go to query the database using the GetSelectCommand() in VB.NET
Exception Details: System.ApplicationException: Number of values provided must be equal to the number of placeholders in query.I have checked the query over and over again .. but its fine .My database server is Sql Server 2008.So my application throws the exception in this command:
Using reader As MustDisposeDataReader = _ pmSystem.DatabaseManager.GetSelectCommand(selectStatementBuilder.ToString(), New Object() {})
Where MustDisposeDataReader is an instance of a class in an internally developed library, which inherits from System.Object. pmSystem is an instance of the class PlanManagerSystem which implements the commandlayer. GetSelectCommand() takes the select command
I need to write a program that requests a high number and a low number from the user, then the program searches the array and finds all elements within the two numbers. The program is used to search for past presidents, so if I type 43 for low number and 44 for high number, the program will display:
George Walker Bush Barack Hussein Obama
I think I have an idea of how to search up to a certain point, but not to stop at a certain point....Here is the code that I have for that particular sub procedure:
Quote:
Private Sub btnDisplayRqst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplayRqst.Click Dim sr As IO.StreamReader = IO.File.OpenText("PRESIDENTS.TXT")
Trying to upload a picture file from an online source and store it in a byte array but am having the error: "Number of Indices is less than the number of dimensions in the indexed array".
Dim Bytes() as Byte Dim Inet1 as System.Net.Webrequest
I have to search within an array and display the number of occurrences that a value within the array appears. I know that my code is incorrect but this is what I have so far. If anyone can point out what I am doing wrong that would be great.
Private Sub btnResult_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnResult.Click Dim intSearchAmount As Integer Dim intCounter As Integer Dim intIndex As Integer
My Find/Replace Edit Menu command inside VB 2005 is not working anymore, and SQL Server 2005 as well. When I tried to check this feature in Microsoft Office applications, there is no problem at all. It's mysterious, I don't know what happen. I also tried to re-install VB and SQL, but still it didn't work.I know it is a petty problem, but it plays an important role when editing your codes.
The code below carries out the query find but continues to add records to the table.I amtrying to find out what the record count is so that I can then performnother action. When the query is executed the first pass the record count is 19.This is valid and matches the DB The 2nd pass the record count is 49, but the DB only shows 30.
Private Sub frmRecordCounts_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim CatClass(0 To 3, 0 To 5) As Integer