Finding The Small Integer Number
Aug 14, 2009
i'm dave mark.. im new to vb 2008.. i just have to have some question.. the problem is i have to input 10 integer number then after inputting the 10 number .. it will compute the sum, average and the smallest.. i have no problem with sum and average but in smallest number only... how to get the smallest number>>?
View 1 Replies
Jul 26, 2011
I have a value of: "2.54334881002458E-37" and i keep getting "overflow" exception when i'm using a double.what should i use to make this work?
code snippet:
Dim curries, act, cat As Double
For Each dataRow As DataRow In dt.Rows
curries = dataRow("Activity")
getting the error when i try to assign Activity to curries.but "activity" is a string in the database....
View 4 Replies
May 14, 2010
How can I join more than one integer number to become one integer (Long) number?
e.g. 2, 3, 2 and 5 = 2325
123, 7 and 2 = 12372
10, 0, 5 and 1860 = 10051860
0, 10 and 450 = 10450
View 6 Replies
Oct 3, 2010
Similar in concept to Math.Abs() - I'm looking for a function that when given a positive integer will return the same integer. If given a negative, will return zero.So:
f(3) = 3
f(0) = 0
f(-3) = 0
Yes, this is simple enough to write on my own but I'm wondering if the .NET Math class already has this built in or if the same can be achieved by cleverly chaining a few Math.* calls?
View 11 Replies
Jun 10, 2009
Is it okay for a structure variable to hold a small number of reference types? I thinks it's fine because the pointers themselves are not that big, regardless of what they're pointing to. But I never did fully figure out the whole heap/stack thing, so I'd like to make sure.
View 6 Replies
Dec 7, 2010
i am creating a shift rota system for a small number of staff basically there is a 3 week rota
week 1 - late
week 2 - early
week 3 - off
i am getting confused on how to calculate which week the member of staff is currently on eg week 1 / 2 / 3 i think i need a datediff with a mod to calculate it but thats where im getting confused (if im even right on that part)
View 3 Replies
Jun 13, 2009
I am taking a VB2008 class and I have the entire program figured out except for one thing. I've checked our text I've scoured the internet and I've tried tons of things.
What this section of code does is access a data file, calculate the average from it... done.. that works, calculates the highest number in it... done that works... and calculate the lowest number from the file... nope... not working. I've tried tons of things and what i have in there now keeps giving me an output of 0, when it should be a 2.
Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
'Calculates average, minimum, and maximum temperatures from data file
Dim month As String
[Code]....
View 2 Replies
Jan 9, 2010
I don't know if I worded this properly, but I have a mdb query that I display in a Datagrid on my form. The first column is TransactionNumber, which is the primary key and a running total (ex. RackingTransactionKey=RackingTransactionKey + 1). What I need to do is when the form is opened, find the highest (last) TransactionNumber from the query or Datagrid and assign it to a variable (RackingTransactionKey), so I can can update it (+1), therefore generating a unique number so I can add data to the query.
[Code]...
View 13 Replies
Jun 7, 2011
I am not an ardent developer in vb.net programming. But off late I am using vb.net to develop a windows application.
The following is what I am trying to do:
I am reading an excel file and storing the string value present in each cell, and trying to match the string in a word file.
The program works fine except that I am having problems in returning the page numbers of the matched string.
The page number value is always returned as one.
The following is a piece of what I had written:
If FindStringInFile(wordfilename, vValues) Then
currentPageNumber = word.ActiveDocument.ActiveWindow.Selection.Range.Information(Microsoft.Office.Interop.Word.WdInformation.wdActiveEndAdjustedPageNumber)
TextBox3.Text = currentPageNumber
End If
wordfilename is my word file and vValues is my excel string data
View 1 Replies
May 10, 2011
Create a program where the user can find the highest number and the smallest number from a list of values It needs to operate as follows: Enter a value (number) in the TextBox and click on a button [Add to list]. Once this is done, the program analyzes if the number is the highest entered or the smallest. To view which is the smallest and largest, a second button [highest and lowest] will populate fields (texboxes) with highest and lowest numbers. I've attached an image of what the program should look like.
View 4 Replies
Aug 27, 2010
I need to make a small programm for ticketing on a parking for a small hotel.So i have 2 Printers pariking In (for delivery of the tickets) and 2 Readers PArking Out.Both Printers and REaders are working Serial.So i need to poll the serial ports of the printers and readers every second.The data is stored on a SQL database so i need to read and write in the database.Can i do this with 1 PC and 1 programm or 1 PC and 4 programms that are runnning at the same time ?
View 2 Replies
Oct 31, 2010
I've just begun using VB2008 Express. As practice, I'm trying to create a simple program that allows users to practice their basic arithmetic skills. I've just run into one hiccup.
I have a procedure that generates random numbers for the program to spit out as text that the user will then do arithmetic on. I'm trying to create a loop that checks, in the case that a radio button selecting division practice, that the potential quotient [code]...
View 3 Replies
Feb 28, 2008
What i'm trying to do is compute whether an integer number is prime or not. The program performs this analysis for all odd numbers from 3 up to an input integer limit, for example 100. If the integer in the range 3 to limit is prime, a message stating so is printed. Otherwise, a message is printed that lists at least one other integer divisor. The output for each analyzed number consumes one line of text.
A sample output is shown below:
Limit is 100:
Number 3: is prime
Number 5: is prime
Number 7: is prime
[CODE]...
I understand I need to use loops, boolean functions, vbmath(), strings and multi-line out via concatenation. So I can put this is words how I think it should be done but not so great putting the code together
Test all integers up to the SQRT of the number (100)
limit = math.sqrt(100) + 1
Followed by 1 For statement
For c = 0 to 100 step 2?
And an If statement
If ......
result = false
View 4 Replies
Oct 11, 2009
I'm trying to create a code to open a new workbook..once it's open I want to save it in numbered order. I have everything else in the code complete except how to finish the integer. I know this should be easy but I'm having a total mind block. [code]
View 1 Replies
Feb 10, 2010
i want to get a random number from an integer array, then delete that number in that array.for example, i have an array like this {1,2,3,4,5,6,7,8,9}now i want to get a RANDOM number in that array ( the number must be in the array), 8 for example. And then delete it from the array.
View 10 Replies
Jun 4, 2012
I know there has to be a simple way to do this but I'm not sure how the syntax would go. I need to generate a random number from 1 to 99. How do I do this? I have my attempt that failed below:
Private Sub LoadBoard()
Dim mynum As Integer = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99)
Storage.Slot1 = mynum(Int(Rnd() * 10 Mod 99))
End Sub
View 11 Replies
Feb 1, 2010
On form 1 , i have a number of buttons that open up different websites.What i want to do is when i click a button on form 1 , i want forum 2 to show ( Form2.show() ) , Form 2 will have a list (Buttons) of internet browsers.
View 4 Replies
Aug 2, 2011
How can i format a double number to be like a integer?
for example:
i want to 12.34 to be rounded and displayed like 12 not 12.0.
because when i do String.Format("{0:n0}", 12.34) the number will be displayed as 12.0
View 3 Replies
Feb 7, 2012
The problem i m facing is that i m getting all numbers in this format
1- if it is double then 123.45
2- if it is integer then 123.00 which is wrong
how to format a number wether it is in decimal or integer.if it is decimal then something like 123.56 or if it is integer then 123 not 123.00.Tell me the generalized string function and how to use it..
View 6 Replies