|
Good day friends! Please, I need your help in this stuff<pre>Dim i As Integer
Dim result As Double
For i = -169 To 2400
result = 0.1857*i*120
Next
</pre>
Please, what will be the final answer because I tried manual calculation as follows but not sure is correct. And I got something like this:
result=0.1875*(-169)*120
result=-3802.5
I know that -169 To 2400 will loop from -168-0 AND continue from 0-2399
Please help.
|
|
|
|
|
I see nothing array related.
But, because result is simply recalculated every time, the final answer is:
result = 0.1857 * 2400 * 120. So.. 53481.6
|
|
|
|
|
Thank you. Does that mean that is only the ubound i.e 2400 that you take? And, what would be the answer to this
For i=(0 To 6, 10 To 20)
result= what!
Next
please help because am really confuse in this...
|
|
|
|
|
yes you are correct, the calculation runs as many times specified in your for loop.
BUT as you are not storing the result in a collection of any type the result variable is overwritten each time with the next calculation.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
You can download Visual Studio Express from Microsoft's site and run this code for yourself to see what it does. You'll learn more that way too.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Ok, I head you all. The problem am having is that, I downloaded a sample program and I saw this line of code
<pre>
For c = 0 To 10
For d = 0 To 12
If (c,d) = 1 Then
'action to perform
Else
'action to perforn
End if
Next
Next
</pre>
And, I don't really know how this will be equal to 1. Please, I need to know how this can be calculated so that the outcome will be equal to 1 in order for me to understand the flow of the code.
|
|
|
|
|
Otekpo Emmanuel wrote: If (c,d) = 1 Then
I haven't done VB in a long time but that sure doesn't look like valid VB code.
I think perhaps you meant:
If SomeArray(c,d) = 1 Then
That would just be a 2 dimensional array (like an Excel spreadsheet (Row, Column) which would also explain the 2 loops.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Thank you all for your replies. Sorry, if am too inquisitive. In the same program, the below lines of code exists:
Public DistX As Integer
Dim Length As Integer
Public DistToDark(1 To 1850) As Integer
DarkX = DistToDark(Length)
Where the value of Length increments by 1. So, assuming the Length value is 2, what will be the outcome of DarkX?
And, below is another
Dim angle, ray_inc as Double
Public sine(-160 To 2400) As Double
Dim i As Integer
For i = -160 To 2400
angle = ray_inc * i * piDivBy180 'where rays_inc =1.85
sine(i) = sine(angle)
Next
Friends please excercise patience and make me to understand the above logics. Believe me, I have searched google, read many articles but I still found it difficult. My questions are;
what could be the outcome of angle = ray_inc * i * piDivBy180 'where rays_inc =1.85?
What could be the possible outcome of
sine(i) = sine(angle)?
Will each element of array sine be equated to sine(angle)? E.g sine(0) = sine(angle) and so...
|
|
|
|
|
I still say the best thing for you to do is run the code yourself.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
result = 0.1857 * 2400 * 120. So.. 53481.6
|
|
|
|
|
Hi everyone,
I am getting a problem: I am using Crystal report XI R2 cliet, Visual Studio 2005, VB.NET. I can export report to .xls, .doc without errors on my computer (development machine).
But, when run my application (exe file) on another computer (test enviroment):
Some my reports can export to file doc, xls file without errors,
some reports get error: "Error in file C:\...\Temp\... The request could not be submitted for background processing" (when exporting to .xls file) and another error: "Error detected by export DLL (when exporting to .doc file)"
Are there anyone know this problem ?
Thank you very much !
|
|
|
|
|
I'd suggest searching for the specific error. There seems to be lots of possible reasons. The first google result I found has some: http://scn.sap.com/thread/1876394[^]
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hello!
I have this Code :
Friend Class MyTestClass
Public Property nr As Integer
Public Property name As String
End Class
Dim mytest As New List(Of MyTestClass)
Dim k as integer=2
Dim s as string="123"
Private sub1()
Dim item As MyTestClass = New MyTestClass With {.nr = k, .FieldName =s}
mytest.Add(item)
Messagebox.show(mytest.contains(item))
End sub
Private Sub2 ()
Dim item As MyTestClass = New MyTestClass With {.nr = k, .FieldName =s)
Messagebox.show(mytest.contains(item))
End sub
Using a button I run first Sub1 , and Messagebox display the "True"
After using another button I run the Sub 2 , and the messagebox display "False".
But should display "True"
Why ?
What can I do to get the correct result ?
Thank you !
|
|
|
|
|
You are creating two items wit the same value, but they are still two separate items and therefore not Equal.
You could define a custom Equals method for the class.
|
|
|
|
|
|
|
Howdy,
In Sub2() you have defined a new MyTestClass but you have not added it to the list.
The item defined in sub1 is scoped to sub1 and exists because it was added to the list. The item in sub2 is scoped to sub2 but was not asdded to the list. You are asking the list to check for an item (defined and scoped to sub2) that has not been added to the list yet.
Private Sub2 ()
Dim item As MyTestClass = New MyTestClass With {.nr = k, .FieldName =s)
mytest.add(item)
Messagebox.show(mytest.contains(item))
End sub
regs.
|
|
|
|
|
Hello !
I have developed an application using Vb.net 2013 , Entity Framework ,and sql server 2008R2.
But I need to have this application in 3 languages ( English , French and Italian ).
I have several forms. On each forms I have labels , buttons , TabControl ... all having English names. ?Also I have a menu on my main fom.
I want an idea , how can I store these names on different languages ad call when one or another language is selected.
- Should I store the names to a table on database ( since I use SQL server ) , or a text file or ?????
- How can I distinguish the names that are for a form or for another.
- On the names for a specific forms , how can I distinguish that the names are for a label , or for another label , or for a button or .....
- When a specific language is selected , how can I call these names and replace to a specific control.
Please give me an idea .
Thank you !
|
|
|
|
|
|
Thank you !
Is there any simple example that I can use as I start ?
Thank you !
|
|
|
|
|
Read the text and create your own example.
|
|
|
|
|
hi
how to implementing drag and drop operation from my application to explorer in vb6.
thanks
|
|
|
|
|
|
hi
how implementing drag and drop operation from my application to explorer.
thanks
|
|
|
|
|
Hello !
I'm using VB.net 2013.
Also I'm using a Spreadsheet control form a third party tools.
I have a problem :
I copy data from an excel document , and Paste to spreadsheet control.
But before paste , I want to analyze the data being pasted.
The analyze that I want to make is :
If the data have been copied from Excel , I want to know how many cells contains each row.
If this number is greater than a specific number (x) , I want to paste only the first x cells and ignoring the others.
Thank you !
|
|
|
|