Have A List Containing One String And Two Numbers?

Jan 28, 2011

Can I have a List containing one string and two numbers? Or I can only have one type of element?

View 3 Replies


ADVERTISEMENT

Use .next (random Numbers) To Randomly Select Something From A List Of Numbers But It Can't Repeat The Number?

Aug 16, 2009

So how would I use .next (random numbers) to randomly select something from a list of numbers but it can't repeat the number?I could do:

dim num as integer
dim r as new random
num = r.next(1,5)
if num = 1 then
elseif num = 2 then
etc.

That wouldn't work because it would repeat.If I donwload someone's game can I disect it in VS? :0 I tried going to open project, then I went to the folder and clicked open. It brought me inside of the folder so I tried to open the game but there is no form1 there. It says the games name then .exe in the explorer-like thing in the top right?Also, how would I have a value or something in a label and access it from a button.

Example:This is in a label.

Dim number as Integer
number = 0

Then in the button do

Label.number = 0

How would I do something like that? I want to use that a lot as I did in a different language.

View 6 Replies

.net - Function To Accept List(Of String), Array & String And Similarly Return List(Of String)?

Jul 29, 2011

I want the Function to accept List(Of String), Array & String and similarly return List(Of String), Array & String respectively. The Function simply adds a string (month) to the input collection. I just want to use it for string, array and list with needing to think of conversions.

[Code]...

View 2 Replies

VS 2005 Displaying A List Inputted Words And List All The Associated Line Numbers?

Aug 1, 2009

I currently have a list of words in a text file sorted in to alphabetical order and put into lower case, but I would like to be able to also display the line numbers on which these words are associated with.. but only one instance of.

For example,

"This is a random text
file that I
have just made
up this second"

[Code].....

As you can see above, I would like to show that "this" for example appears on line 1 and 4. Hopefully tabbed so that it keeps a nice look to it.

View 1 Replies

C# - With LINQ, How To Transfer A List<List<string>> To List<string>

Dec 15, 2010

I got an object of List<List<string>>I need to bring this into a ist<string>I have no idea how to do this with LINQ.

View 1 Replies

String Registers All As A String And Doesn't Actually Calculate Random Numbers

Jun 12, 2011

The string itself contains things like "random" & random.next(1,3) & "random2" etc. The string registers all of this as a string and doesn't actually calculate random numbers.Is there any way to fix this?

View 8 Replies

Keep Last 10 Numbers In List?

May 29, 2009

i want to keep only the last 10 numbers in a List.

The list is declared as: Dim LastPlayed As New List(Of Integer)

I then Add several Items, each time checking LastPlayed.Count is no bigger than 10.
If it is, i only want to keep the 10 most recent numbers.

View 7 Replies

Converting A String Of Letters To A String Of Numbers?

Apr 10, 2009

I'm having a problem converting a string of letters to a string of numbers. I've tried:

Dim A As String = ""
Dim strOutput As String = ""
Dim X As Integer = 0

[Code].....

View 4 Replies

Add Every Combination Of List Of Numbers

Nov 1, 2010

VS2010
VB

I would like to be able to add every combination of a list of numbers to determine which combinations equal a specific result.

Simple Example:

List: 2, 4, 6
Result: 10

How many and which combinations of numbers result in the number 10? The correct anwser is only one which is 4 + 6 = 10. The example is simple but the actual list may contain as many as 10 - 15 decimal numbers.

I have thought of the following as a possible way of checking each combination by using binary:

- There are 3 total number so the possible combinations would be:
123 - Three numbers
000 - Add no numbers
001 - Add the last number

[Code].....

However, I don't know how to actually match up the bitwise bits to the numbers in the array to actually add. Example:

101 - I should check if 2 + 6 != 10 per the example above so this wouldn't satisfy the result... does this make sense? The answer would be 4 + 6 = 10.

how to check and add all combinations from a list of numbers to determine if the result is a specific number?

View 2 Replies

Asp.net - Asp Dropdownlist - Add Numbers 1-15 To List

Sep 28, 2010

Is there a way of adding the values 1-15 to an asp dropdownlist without having to do each one individually... I currently have:

[Code]...

View 6 Replies

Average Of Numbers In A List Box?

Feb 16, 2012

I am working on a project where i need to get the average of 6 numbers i enter in a ListBox. There is one ListBox, one button to get the average, and one label where the average is displayed. i need to use an array and I am using the Visual Basics Programming but i dont think it is that big of a difference.

View 5 Replies

Generate A List Of Numbers?

Jul 16, 2010

I'm trying to generate a text file that contains a list of numbers.This is what i have :

Dim startint As Integer
Dim endint As Integer
startint = TextBox1.Text

[code]....

View 3 Replies

Finding Average Of Numbers In A List Box's?

May 4, 2010

Need to calculate Average Plan Duration for the 3 Shipment TypesSo far i haveQuote:

'CALCULATING AVERAGE DURATION FOR STANDARD
Dim iAverage As Integer
Dim iAvgDuration As Integer

[code]....

I uses the information from the list boxes, (lbShipmentDuration) and (lbShipmentMethod) to calcualte the average Duration for each Shipment Type.

View 19 Replies

Getting Random Number From List Of Numbers

May 20, 2012

getting random number from list of numbers is getting me sick. i am trying to do it for like 20 days now but every time i do it ends up in a loop wich crashes the my.settings system. does anyone have an idea how to get a random number from a list. then delete that number so it cannot be called again. my system must mark some items with numbers but non ofthe numbers may be used more then 1 time the max items in my system is 90. so from 1 to 90 without getting 2 times the same number heres the code i tryd

[Code]...

View 14 Replies

How To Generate Numbers From List Or Textboxes

Mar 31, 2010

I want to make a program like this but not with random numbers ! I want it with A list from ".txt" or "from number 1 to number 999999999"

Public Class Form1
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Timer1.Start()
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Timer1.Stop()
[Code] .....

View 8 Replies

Randomize A List Of Numbers 1 - 24 And Have No Repeats?

Aug 7, 2009

I'm trying to shuffle a Euchre Deck and it works but I feel like I'm cheating. Is there a more concise way to randomize a list of numbers 1 - 24 and have no repeats? ex. 14, 3, 18, 23...

Dim Deck() As String = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}
Dim A As New Random
Dim B As Integer = A.Next(0, 24)
Deck(B) = "9 of Clubs"

[code]....

View 7 Replies

Store Two Related Numbers In A List?

Sep 21, 2010

Is it possible to store two related numbers in a list and then check them if the are exist in the list?ere is an example of what I did to achieve the above:

Dim CounterConnections, FromN, ToN As Integer
Dim ConnectionsList As New List(Of Integer)
Dim Myrandom As New Random

[code]....

The above code generate two random numbers and store the in a list. I am adding the two numbers to be one so that I can check if they exist in the list.e.g. if the FromN = 7 and ToN = 11 then the list will consist of :

711 and 117

a list to store 11 7 and 7 11 which is capable to be checked later if some some numbers are exists.

View 3 Replies

Using Randomly Generated Numbers From List Only Once

Mar 16, 2011

Below is a form which produces a graph, the idea is to produce 6 random numbers from a range (0,6) place the numbers in an array then use these numbers to produce columns on the graph, however at the moment it is using the numbers more than once, how can I get it to just use the values once only in the array.

Private Sub btnGraph_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGraph.Click
txtAns.Text = ""
g.Clear(Me.BackColor)
g.DrawLine(Pens.Black, 50, 70, 50, 420)
[Code] .....

View 7 Replies

Vb6 Migration - List The Used File-numbers In VB 3.5?

Nov 23, 2011

how to enumerate the used file-numbers [as in FileOpen(filenum, ...)] in Visual Basic .NET 3.5 (VS2008)?

The situation is: I'm doing "a quick port" (just to bring it up a supported architecture) of an old VB6 WinForms application (it's "just a tool" really, not a full-on app) to VB.NET using Visual Studio 2008's automatic translator, over the .NET 3.5 framework. The existing code stores "records" in parallel arrays, the index of which is the output-file-number, and output-files are opened and closed "ad hoc"... so I can't "just" use FreeFile (I could, but it'd basically be a rewrite, which we won't get paid for).

After translating I've got an "invalid filename or number" error upon FileOpen'ing filenum=350 for Ouput... I know the filename is valid, and doesn't already exist. I tried (just for debugging) setting filenum=FreeFile and that worked (i.e. the file was opened)... so I figure that filenum=350 is already open, but how to tell BY WHAT? A listing of the used filenums -> names would give a huge leg-up.I suspect this just isn't possible, but I've got to ask anyway, because it was save ever-so-much time, effort, and thought if it is possible, so here we are.

View 1 Replies

VS 2008 Generate Numbers In List Box?

Dec 8, 2010

Create a GeneratedNumber application that stores in an array with indexes 1 through 100 numbers generated by the index values when Generate is clicked. Generate the number to be stored at each index by summing the index and it's individual digits. For example, 25 should be stored at index 17 because 17+ 1+ 7 = 17 and 4 should be stored at index 2 because 2+ 0 + 2.

Your program should use a FillArray() procedure to generate the nuymbers and DisplayArray() procedure that displays each index and its element in the list box.

[Code]...

View 6 Replies

Adding Numbers From List Table Data?

Nov 30, 2010

how to add together integers from the end of a list array based on certain criteria. example: a list of students assignments and grades, and im trying to add all of the grades from a certain student up based on the student id from the user.

the student table looks like this:
111 H1 09/12/2010 17
111 P1 09/14/2010 42
111 H2 10/02/2010 18

[Code].....

View 2 Replies

Create A Sub Menu That List Part Numbers?

Oct 27, 2010

I would like to create a sub menu that list part numbers that are gathered from a xml file. I am having trouble with creating the sub routines for the part numbers menus because it can change.

Private Sub mnuP1Layers_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim BFFile as string
My.Computer.FileSystem.MoveFile(BFFile, "C:ExchangePrintedBFFile")

View 3 Replies

Load An Array With 30 Numbers That Print To A List Box?

Nov 5, 2009

I am trying to learn about arrays and the for next..loop. This is a noob question but I cant seem to get it to work. I am trying to load an array with 30 numbers that print to a list box.

Dim a(29) As Integer
Dim strVar As String = "{0,-5}{1,5}{2,5){3,5}{4,5}"
Dim x As Integer

[Code].....

For some reason I keep getting errors in the output statement that says "Input string was not in a correct format."

The output should list 1 to 30 in the list box

View 5 Replies

Message Box To Show The List Of Numbers Entered

Dec 15, 2007

Im trying to do a lab that will obtain 10 numbers from the user using an InputBox() function, store them internally in a one-dimensional array, and then compute the average of the numbers and sort them in reverse numerical order. The program should control that 10 numbers (no more, no less) are entered, and that the numbers are fully validated as integers.

If the user enters non-numeric data, then an appropriate error message should be shown, and that number should be allowed to be re-entered as a valid number. Then all the numbers should be shown as a list in a 'message box'. So far I can get everything but the message box to show the list of numbers entered.

[Code]...

View 14 Replies

Sort A List Properly So The Numbers Are Truly In Order?

May 17, 2009

how do I sort a list properly so the numbers are truly in order?

BAD GOOD
1 1
10 2
11 3

[code]....

View 6 Replies

VS 2008 List Of Numbers Included In An Array?

May 18, 2010

I have an array of integers (5 x 5). Is it possible for an index to have a a list of numbers?For example, Row3, Column 4 has 10, 4 52,10 Array (3,4) = 10,4,52,10

View 4 Replies

VS 2010 Declare All Numbers In An Array Without Going Down List One By One

Feb 26, 2011

So I have an assignment dealing with arrays for school but first I will start it off with the simple question as to where I am stuck now. I was wondering what the simplest way is to declare all the numbers in an array without going down the list one by one ( ArrayA(1) = 1, ArrayA(2) = 3 and so on.) I was wondering if the simplest way to do this is just by putting: ArrayA = ArrayA += 1 or what the simplest way to do this is.

View 6 Replies

Play With List Of List Of String With Javascript Or Jquery Using Ajax?

Dec 5, 2011

We're working on a big ASP.NETVB.NET website project. I need to populate three dropdownlists. To last two are independent of the previous ones. The population data comes from an SQL Server. I'd have no problem doing this with code-behind with post back but we don't want any PostBacks so I started to develop this in AjaxjQuery.

[Code]...

View 1 Replies

C# - LINQ To SQL - Selecting A List Of The Highest Version Numbers?

Oct 19, 2009

I am trying to write some Linq to SQL that will bring me back a list of rows containing a single instance of BaseQuestionIDs but I want the row with the highest version, so, from the following table of data:

Id CreatedDate Version BaseQuestionID
2 2009-10-07 13:47:27.687 1 2
3 2009-10-07 13:49:35.010 1 3
4 2009-10-09 16:03:45.973 1 5

[code]...

I want to return:

Id CreatedDate Version BaseQuestionID
2 2009-10-07 13:47:27.687 1 2
3 2009-10-07 13:49:35.010 1 3

[code]...

I have tried a variety of things, but have not nailed it yet. I am working in vb.net?

View 1 Replies

Create A Program To List A Large Group Of Numbers?

Feb 7, 2011

I am currently trying to create a program to list a large group of numbers for me. My final goal is to have every 2, 3, 4, ..., and 9 digit number containing only "1" "2" and "3". I thought I would go about this by using the following VB.NET program and then copying it into a text editor, and using find & replace to eliminate all other numbers.

Public Class Form1
Dim Start As Integer = 333333333
Dim Counter As Integer = 333333333

[Code].....

it fails due to the massive amount of processing that needs to take place. However, adding the intervals requires a great deal of time for each number to be displayed without any crashes.

Is there some way (in VB.NEt or another language) to get the number list I want in a short (an hour or less) amount of time?

View 7 Replies







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