Finding The Max & Min Of An Array

May 10, 2009

I have some code that generates 15 random numbers between 1 and 100 and prints the 15 numbers in a listbox. I want to be able to find the max and min numbers in that list. How would I go about finding those values? I'm new to VB so a solution involving basic string/array manipulation would be preferred.

View 2 Replies


ADVERTISEMENT

Finding Squares In An Array?

Oct 9, 2010

I have an 2 dimensional array that is full of 1s and 0s such as

0 0 0 0 0 0 0 0 0 0
0 0 1 1 1 1 1 1 0 0
0 0 1 0 0 0 0 1 0 0

[Code]......

Also the array must be able to have more than one square.

View 1 Replies

Finding The First Empty Value On An Array?

Aug 21, 2011

find the first empty value on an array?Say I have a directory and will occasionally be adding and removing items from an array to represent this. How would I go about making a loop until the entry is empty. I've tried various things like if null and that sort of thing but none of them seem to work- the problem is I guess that this array value is empty and the system can't deal with it without throwing an error message.Creating an array of a set size from the start isn't an option as I've no idea how big the directory will ultimately be.

View 19 Replies

Array Searching - Finding Closest Value?

Dec 10, 2008

Say I have an array of doubles sorted from smallest to largest. What is the FASTEST way to find the closest value in the array that is LARGER/SMALLER than the search value if an identical value is not found.

Code:
dim myArray() as double = {1.245, 2.45, 3, 4.556, 5.4434}
'LARGER AND SMALLER SEARCH for 3 should obviously return 3 because its in the array.
'LARGER SEARCH for 2.46 should return 3 because it is the closest LARGER value
'SMALLER SEARCH for 2.46 should return 2.45 because it is the closest SMALLER value

I certainly can do this on my own, but I am looking for the fastest way.

View 3 Replies

Finding Distinct Values In Array?

Feb 15, 2012

I have a database which need to be assigned into array arr()(), e.g.

arr(0)(0) = aa arr(1)(0) = ab arr(2)(0) = aa
arr(0)(1) = bb arr(1)(1) = ba arr(2)(1) = ba
arr(0)(2) = cc arr(1)(2) = cc arr(2)(2) = cc

I need to find distinct / unique value in each arr(k)(0), arr(k)(1), arr(k)(2); where k=0..2. Then i need to insert the result into array cat as follows:

cat(0)(0) = {aa} cat(0)(1) = {ab}
cat(1)(0) = {bb} cat(1)(1) = {ba}
cat(2)(0) = {cc}

I've tried code below but it doesn't work. The assigning process into array arr()() from DB is OK. Problem only come up if I try to find the distinct value (If Not (cat(j).Contains(ds.Tables(0).Rows(i).Item(j))) ... End If).

For i = 0 To 2
list(i) = New Integer(3) {}
For j = 0 To 2

[Code].....

View 2 Replies

Finding Largest Data In An Array

May 9, 2009

[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?

[Code]...

View 8 Replies

Finding Missing Values From Array?

Feb 3, 2011

I am trying to find a set of missing values between an array and cell values from a DataGridView. The array is a set of numbers from 1 to a user-entered maximum number. For example, if the user enters 10, then the array will have the values 1,2,3,4,5,6,7,8,9,10. The rows in the DataGridView might have values such as 2,4,6,8. I want to create a second array that would have the values 1,3,5,7,9,10. I believe I need to loop through the array values and compare them to the row values in the DataGridView. But I'm stuck on the method of either adding or removing values (or doing nothing) to the second array as the array value loops through the DataGridView. logic or some VB Code that will produce the results I'm looking for?

View 8 Replies

Finding Pattern Without String Array?

Nov 14, 2011

Im trying to make an on access file scanner, YES I know that C++ is better, but this is a concept of thought, trying to challenge myself to see if its possible in vb.

Anyways, I have a list of Hex definitions, my question is, how can I index this list so I can access the definitions faster. A definition looks like this:

Eicar.Test.File.a=58354f2150254041505b345c505a583534285

The part after the equals sign is the HEX signature, while the first part is the name of the definition.

Basically what I am trying to do is index them somehow where I can scan faster, as I have over 60,000 definitions and I have to split each individual one in order to get the signature name. It takes about 45 seconds or so to scan a 500KB file. I need it to be WAY faster.

View 1 Replies

Finding Value - How Many Indexes Of Array Filled

Jul 9, 2010

I have an array Newstr(20) When I fill it, I need to know how many of its indexes has been filled ? and find out the values.

View 3 Replies

C# - Finding Position Of An Element In A Two-dimensional Array?

Jul 15, 2010

Say I have a two dimensional array

[0] [1] [2]
[3] [4] [5]
[6] [7] [8]

Now suppose I want to get the position of the number 6

I know with a one-dimensional array i can use Array.indexOf() but what would my options be with 2-dimensional arrays?

View 3 Replies

Finding Distinct Element From Array Before Select Statement?

Nov 8, 2009

I have an array with wild character at the end. I use the value in this array in Select statement. Some times the array has same values. I want only distinct values in the array before the select statment.
Code:
for i=0 to count
select * from tbl where item like ' " & itemname(i) & "'
next
I need distinct element in itemname array.

View 1 Replies

Searching And Finding Strings Inside A 2-Dimensional Array?

Nov 14, 2011

I am working on arrays and I am currently having trouble with searching and finding arrays. In this example, the user should be able to enter a Name, and it will output that person's stats.

Here is the text file (note, I should be able to go to this text file, add a few more names and the code should still work, which is why I am using loops,arrays,text files instead of if and else statements),

Kobe,29,6,4
Allen Iverson,28,7,4
Jason Kidd,12,10,9

So if the user enters Jason Kidd in the text box, this will display in another text box:

Jason Kidd averaged 12 points, 10 assist, and 9 rebounds.

[Code]...

All right now is the searching part. I really do know how to search for what the user entered and display the statement in a text box. I kind of have an idea of how to just get the name, but for it to get the name and then all the data for that name puzzles me even more.-I tried using .contain, indexof and few others.

I know to display the information in the text box will be something like:

textboxoutput.text = PlayerName & " averaged " & PlayerPoints & " points, " & PlayerAssist &" assist, and " PlayerRebounds " &" rebounds"

So basically, I want it to where the user can enter a basketball players name and display the values for that name.

View 4 Replies

Finding Lowest And Highest Element Of Array And Their Indexed Position

Jan 19, 2010

Entered an 5 elements of an array so is has 4 index? I need to find the lowest and highest element of an array and their index position
Example: I enter 1 2 3 4 5
The output should be like this
The lowest is 1 and position of index is 0
The highest is 5 and position of index = 4

View 5 Replies

[2008] Finding The First Empty String In A String Array?

Mar 2, 2009

i have a string array that i want to output to a text file. the array size is 10000. i fill the array starting from 0 with some strings. at the end, i only want to show the array from index 256 to the last array that is not empty (for eg. if the array is filled with data from 0 to 2000, i only want the text file to show the data from 256 to 2000 and ignore the remaining strings). Is there any function to do this?t i use is shown below

Dim myArray(10000) as string
Dim strArray As New System.IO.StreamWriter("c:List.txt")
strArray.WriteLine("{0,10}{1,30}", "Index", "Symbol")

[code].....

View 8 Replies

Finding The First Empty String In String Array?

Mar 2, 2009

i have a string array that i want to output to a text file. the array size is 10000. i fill the array starting from 0 with some strings. at the end, i only want to show the array from index 256 to the last array that is not empty (for eg. if the array is filled with data from 0 to 2000, i only want the text file to show the data from 256 to 2000 and ignore the remaining strings). Is there any function to do this? i am using visual basic express 2008. The code that i use is shown below

[Code]...

View 2 Replies

VS 2010 : Copy This Array To A Temp Array So That The Temp Array Has All The Same Values As The Original Custom Array?

Jun 19, 2011

I have an array of people stored in a custom structure array... how can i copy this array to a temp array so that the temp array has all the same values as the original custom array?

View 4 Replies

Seaching An Array - Store In A 1d Array A Set Of 5 Place Names And In 2d Array The Distances Between Places

Jul 28, 2010

I am trying to create the following program Store in a 1d array a set of 5 place names and in a 2d array the distances between the places. Ensure that the order of the places is the same in both arrays. When the names are places are input the distance between them is displayed. If they are not both in the table a suitable message is displayed

Dim town(1 To 5) As String

Dim Dist(1 To 5, 1 To 5) As Integer

Dim First As Integer

[CODE]......................

I think the best way forward is pass a parameter to the function findnumber.

View 1 Replies

Finding Age From DOB

Mar 16, 2011

My EmpTable is in SQLserver & Data entry using Visual Basic 2010 "List format" on Windows form.Sir my requirement, if I enter (Date of Birth) in DOB column the Age should display on the same form in Textbox.

View 3 Replies

.net - Finding Out The Datetime Value

Jun 7, 2011

In my vb.net winform application, I am moving the file from one folder to another. I need to store the datetimevalue when the transfer has been done. Later I need to show this DateTime value in my Grid. Here is the code i have written, but not able to store the datetime value.

[Code]...

View 2 Replies

Finding A Control In .net

Mar 3, 2010

In vb.net I have control named checkbox1 that I can see at dropdown menu in properties tab. but in designer I am not able to locate it... Also when I am selecting CheckBox1 from properties' dropdown menu, no checkbox in designer gets highlighted.... How to find that control in designer?

View 3 Replies

Finding A Decode Key

Jul 19, 2011

I have to provide a client with a method to retrieve data from an Audiometer. The equipment is discontinued, but they have six of these and are used every work day. Using port monitoring and the DUMP command on the peripheral I was able to read the data and save to file. Now my challenge is decoding each line. It appears that only a section of the string is not in plain values.I added the pipe separators for clarity. I have determined those columns are: EMPID | DateTime | TechID | Results | ResultType = Test.[code]

View 8 Replies

Finding A VB, Or C# Or C++ Dll Injector ?

Aug 26, 2009

I have been finding a VB, or C# or C++ Dll injector for a long time. Ive decided to make one. So in VB i went to toolbar and found "Process" and i didnt know what to do after. how to make one (dont post code). Ive tried using the "GetProcessByID" thing but dont work.

So far what i did:

If Process.Start("Engine.exe") Then

End If

Also how do u make it inject the "DLL"?

View 4 Replies

Finding A Winpcap For .net?

Jan 25, 2011

Is there a Winpcap for Visual Basic .net?

View 8 Replies

Finding An Image?

Aug 7, 2010

I'm looking to take a screen shot with my program and try to find an image inside of it. Is this possible?In other words, I am trying to find an image inside of a larger image. It would be great if it could be a screen shot of just the webbrowser form.

View 18 Replies

Finding And Opening Wow.exe With VB?

Apr 30, 2009

I can't find out how to find and open the program wow.exe using VB.

I can get it to open mine but it can't open other peoples they get errors when they try, I have xp and the Vista and other people can't get it to open theirs so I need to know how to find the file then open it.

The code I'm using is this:

Private Sub Play_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Play.Click
Dim installpath As String = String.Empty

[Code].....

View 7 Replies

Finding The Name Of The First Worksheet

May 27, 2010

I am trying to find the name of the first worksheet in excel. I can get the list of sheets, but i need to know which on is the first one in the workbook. using vs 2010 and office 2007

View 1 Replies

Finding Where App Is Running From?

Aug 22, 2011

under VB6 I used to use the code app.path, what is it under VS2008

When I write the final code I want my program to install the exe and support files in the same directory/folder

In the software I want to be able to refer to these support files when needed
Regards Princy558

View 4 Replies

Page_PreRender Finding Div By Id (asp.net VB)

Sep 1, 2011

I am trying to run some code on Page_PreRender but only want it to run on hyperlinks within a certain DIV. What the code does is change the colour of a hyperlink if the NavigateUrl = the URL of the page the user is on. I have some code that works but it changes the colour of every link on the page that matches when I only want it to happen within a certain div.

[Code]...

View 1 Replies

.net - Finding A Memory Leak Cause?

Feb 9, 2010

I have the following Leak situation in a VB.NET (.NET2) application: a form - DetailTache (TaskDetails) - in my MDI application is not garbage collected is not collected ofter open/close.

EDIT: Result search from projet of WinComboRowSelected Event. There are 3 usages of this word in application:

Declaration in Class WinCombo: Event WinComboRowSelected(ByVal sender... (only one)
Raising: RaiseEvent WinComboRowSelected(sender, (3 raisings)
Usage: ...e As Keolis.ctlWinCombo.WinCombo.WinComboRowSelectedEventArgs) Handles cmbProduit1.WinComboRowSelected (multiple handles).

there is No other usage of this event.

View 5 Replies

.net - Finding Path Of Application?

Jul 7, 2011

In a VB application I am building, I need to launch Outlook. Obviously, on every computer the path to Outlook will not be the same. Thus, I need to know how to find the path of Outlook on the user's computer before I Shell("path"). How would I do this?

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved