Collecting Numbers From A Loop?
Jan 31, 2012I am trying to get the numbers from a text field .the format of the text field is ##d##+## (number sighs represent actual numbers)[code]....
View 1 RepliesI am trying to get the numbers from a text field .the format of the text field is ##d##+## (number sighs represent actual numbers)[code]....
View 1 RepliesI am making a webrequest to a web page, and need to collect some data which is arranged like:
<tr bgcolor="#ffffff" class="text" height=10>
<td>Name1</td>
<td>Age1</td>
[Code]...
I cannot seem to make my for next loop work for a class project. Essentially, I have a list box that is populated with strings of numbers. I am required to use a loop to sum the total of the numbers in the list box and display them in a label. I chose to use a For Next loop. However, it's not working. I'm getting an error when I try to convert the strings to decimals.[code]
View 12 RepliesI have a text file (*.txt) with a name in each line, like this:
Joe
Dane
Lisa
Kelly
Now I want each name added with a number from 1 to 99.
Like this:
Joe0
Joe1
Joe2
[code]....
I have folowing code:
For n As Integer = 0 To (numbernames) - 1
strContents = objReader.ReadLine()
For i As Integer = 0 To 100 - 1
[code]....
With this code all happens ok and a new text file is created with the desired name-list with added numbers.The only problem is that the last name doesn't get a number added from 0 till 99 but for example 0 till 17.
I'm having a serious brain fart over this but I need a looping statement that will display all prime number from 6 to 10000.
View 3 RepliesWrite the pseudo code needed to sum only the even numbers from 1-n, where n is a value given to you by the user
And I have something like this:
Dim x as integer
n = txtUserNumber
For x = 1 to n Step 2
Total+= sumofnumbers
Next
I am trying to make a loop to calculate the total costs for 12 days of costs. It has to compound sort of though. I need the total = cost for day 1(includes day 1) + cost for day 2(includes day 1 and 2) + cost for day 3(includes day 1, 2, and 3).....up to day 12. I have a for/next loop in my array, but it calculates the total for 12 days, but I need it to add as explained above. I have been strategizing and the program needs V= day 1 then add V to T. Then V needs to clear and then loop again so V=day 1 + day 2 then add V to T. Then V needs to clear and loop again so V=day 1 + day 2 + day 3 then add V to T and clear V.........up until all days are added together. If anyone has any suggestions or any idea of what I am talking about please comment! Here is the link to another forum that might explain the program in more detail:
Here is the code for my program so far:
I am trying to loop through a dataset and process n numbers of records at a time.For example lets say I have around 240 records in my dataset. I need to loop through the dataset and then create a new batch of 50 records. so for the dataset which has 240 records I want to create 6 batches. Out of these 6 batches, 5 would have 50 records and and last batch would have 40 records.
View 1 Replieshow to loop an SWF file using specific frame numbers. I don't want the SWF file to play thoroughly. I know that frame 1 in Flash is 0 in VB, frame 2 in Flash is 1 in VB, etc.
View 5 RepliesMy loop that needs to count and accumulate the numbers from a list box does not work. When I debug it reads the first line of the Do While loop then jumps to the code where it would average the numbers. Here is my code:
'calculate average
'get first item in list box
lstListBox.SelectedIndex = 0
[Code].....
I have attached the form in initial state. What you don't see in the initial state is 10 hidden labels. I want the loop(which I am calling as a function??) to compute the numbers and display in the labels. Example, if I input 1 for the first term, 3 for the second term and 4 for the total terms, the first 4 labels should become visible and have in them one solution each:
1 - 1
2 - 3
3 - 4
4 - 7
Am I way off with what I want to do? Cannot use arrays, must be a loop.This is the compute button:
Private Sub BtnComp_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles BtnComp.Click
Try
[code]....
i have wrote a loop to search for duplicate numbers within a column in a database which i have got fine but when i find a duplicate i would like to get the all of the row so if 33 was a duplicate i would like to get the following row.
33MarkWhitesideM12/07/1958Michaeluuu
I have tried to do this buy use something i saw on msnd's website:
Dim foundRow() As Data.DataRow = customerDS.Tables("Details").Select("HNCNO Like '33%'")
However if i change the line to notice the i beside the like
Dim foundRow() As Data.DataRow = customerDS.Tables("Details").Select("HNCNO Like 'i%'")
but i get Index was outside the bounds of the array. Ok i know that means that there is nothing in my array. What i would like is to find the duplicate row associated i. you will probably understand me better when you see the code.
Private Sub checkRowsForDups()
Dim customerDS As DataSet
Dim dupArray As New ArrayList
[Code].....
I need some guidance on a little program I'm making (one that I thought would take a couple of hours from start to finish, it's been days now ...) that determines all of the proper divisors of any given number up to the maximum value of a UInt32.
View 8 RepliesI need to add a loop to allow repeated checking of ISBN numbers, which should check to determine when processing should be ended and should allow exiting the program without having to enter an ISBN before quitting. I also need to use a Select Case for the three ISBN possibilities (ISBN-10, ISBN-13, invalid ISBN length).
[Code]....
I've got Visual Studio 2010 and I am looking to clean up my code technique, since I've taught myself and now I'm taking classes.
I'm trying to use a For...Next Loop so that I can fill a text box with sequential numbers. For some reason, all I can get in the text box is the last number and I feel that at this point I'm probably overthinking it...
All I want is on the button push the text box shows:
Here's what I have:
CODE:
Once I grasp this simple concept, I can move on to the actual challenge ahead of me, but I really want to know the proper way to handle this with out going all spaghetti code.
Pretty basic question, I have a checkboxlist inside of a wizard control. I need to collect the value of all items that are checked, as well as whatever value is inside of a textbox if "other" is checked, to insert into my database during the Wizard.FinishButtonClick event. How do I do this?
View 1 RepliesI have a need to collect only IPv4 MAC addresses. Currently I use this Code: But this brings up IPv6 MACs as well. How do I exclude the v6 MACs?
View 4 RepliesHow can I collect details regarding the hardware and software, of a PC ?As for registration process of the product (my app), I wish to collect the details of that PC and get it saved into my server.When the client request for a new serial key, because of formatting the PC and other reasons, I would compare the PC details and will issue a new serial key based on the result. (small changes in the PC will not be considered)
View 4 RepliesI'm working on an app, this is my third or fourth, but this one is throwing me for a loop(I'm in no way trained in VB btw...)Here's a pic of the app:
The whole point is to use the "<" & ">" buttons to move the cursor left and right. When you do, it highlights a single character as it moves. Then, once you select a color button, it adds a special character BEFORE the highlighter character.
Ex: Help = He^6lp ^6 being one of the colors.
I don't even know where to start
Here is my need for a windows form program. I have a program that creates .xml files with the same name but on different dates. It is broken down by Type/Date/Time/file.xml. The "file.xml" is the same name every time.
What i need is to grab all of these xml files and export them to excel by pulling certain information out of them.
coding for searching through a windows file structure to pull these files out.
There will be something like 30-40 of these files spread throughout different "Type", "Date" and "Time"
I'm trying to collect a string (filename) after it get's renamed if file exsit on upload into an array. No matter what I do I can't get it to display to a label. Been working over two weeks on the issue
Private Sub uploadfiles()
Dim uploads As HttpFileCollection
uploads = HttpContext.Current.Request.Files
[Code].....
With my CheckedListBox, I am trying to get the text of each item that is checked and add it to a listbox, but it does not get everything currently checked. If I have 3 items checked, it only adds 2 items. If I deselect an item, it appears.
lstOpCodes.Items.Clear()
Dim OpCodeCollection As CheckedListBox.CheckedItemCollection
OpCodeCollection = chkOpCodes.CheckedItems
For Each opcode In OpCodeCollection
lstOpCodes.Items.Add(opcode)
Next opcode
Most of my treelist code is working ok, however I would like to produce two arrays of string, one which contains all the parent nodes in a Treeview, and the other with all the child nodes. I'm obviously doing something stupid as I have "Object reference not set to an instance of an object." I'm not declaring something.
This is my attempt:
Private Sub listbuilder(ByVal nodelist As TreeView)
Dim parentlist() As String
Dim childlist() As String
Dim j, n As Integer
[Code] .....
I have used list views for a project. I have used sum items on the items. The sub items are prices of products. I will need to use these sub items to come up with a total.Also, i have used to listviews, for a smoother look and feel. You click the product which then is removed from the list view and added to the second one. Would this also "move" the sub item across to the other list view?
View 1 RepliesI've created a function that works very well, but it's limited to AD groups direct membership. I would like to display all AD groups a user belongs to, included the nested one.
Here is my
[Code].....
How do I make a loop from 1 to 100 and make it everytime it loops display incrementing numbers to the screen?
View 1 RepliesMakes the following statement about the code below:
**"The computer evaluates the loop condition in the Do...Loop statment to determine whether the loop instructions should be processed. In this case, the inputsales <> String.Empty condition compares the contenst of the input sales variable to the String.Empty value. As you know the String.Empty value represents a zero length, or empty, string if the inputsales variable is empty, the loop condition evaluates to True and the computer process the loop instructions. *If on the other hand the inputsales variable is not empty, the loop condition evaluates to false and the computer skips over the loop instructions.
Based on the code I think it is the opposite: ...that while the inputsales value is not empty it should evaluate to true and process the loop and if it is empty it should evaluate to false and skip the loop?
See below.
Option Explicit On
Option Strict On
Imports System.Globalization
[CODE]...
I have six textboxes, and upon button press it randomly generates six numbers, one in eact text box e.g. [43] [85] [93] [1] [0] [17]..i create another six textboxes and at the same time allocate these numbers in ascending/descending numbers.I am not looking for any codes whatsoever, as i love the challenge of VB.Net.
View 2 RepliesIm trying to write a program that will do:
1.The average of the four numbers. This answer will be placed into a text box reserved for that value. This text box cannot be changed by the user.
2.The maximum and minimum values. These will be denoted by changing the color of the largest number green and the smallest number red.
3.The range of the numbers. The range is defined as the difference between the largest and smallest numbers. The range will be placed into its own text box, labeled as such. This text box cannot be changed by the user."
Im using visual studio 2008 and it has to be written in VB
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.