| | |
need help to pass values to array in for loop
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2009
Posts: 3
Reputation:
Solved Threads: 0
can anyone please help me?
i have two decimal arrays l(15),r(15)
loop has to repeat for 16 times.l(15) , r(15) is the result i have to get.i wrote function F and it is executing perfectly.but atlast r(15) and l(15) is showing as system.decimal[].if i tested with ordinary variable other than array variable.its giving result.values are not passing to arrray
For b As Integer = 0 To 15
t = Decimal.Parse(r(b).ToString)
dim ta as decimal=Decimal.Parse(((l(b) And F(r(b)))).ToString)
'above line is working perfectly and its showing result.
r(b + 1) = Decimal.Parse(((l(b) And F(r(b)))).ToString)
'above line is not working.its giving result as system.deciamal[]
l(b + 1) = Decimal.Parse(t.ToString)
Next
i have two decimal arrays l(15),r(15)
loop has to repeat for 16 times.l(15) , r(15) is the result i have to get.i wrote function F and it is executing perfectly.but atlast r(15) and l(15) is showing as system.decimal[].if i tested with ordinary variable other than array variable.its giving result.values are not passing to arrray
For b As Integer = 0 To 15
t = Decimal.Parse(r(b).ToString)
dim ta as decimal=Decimal.Parse(((l(b) And F(r(b)))).ToString)
'above line is working perfectly and its showing result.
r(b + 1) = Decimal.Parse(((l(b) And F(r(b)))).ToString)
'above line is not working.its giving result as system.deciamal[]
l(b + 1) = Decimal.Parse(t.ToString)
Next
•
•
Join Date: Dec 2002
Posts: 461
Reputation:
Solved Threads: 56
First I don't know what F is returning. Is it a decimal?
Next you are converting a decimal to a string and then converting it back to a decimal. Big waste of resources. If F is returning a decimal then remove all Decimal.Parse.
You are going to run into problems when b gets to 15 and try to set r(b+1) which is 16, You will get an index out of range error.
Next you are converting a decimal to a string and then converting it back to a decimal. Big waste of resources. If F is returning a decimal then remove all Decimal.Parse.
VB.NET Syntax (Toggle Plain Text)
Dim r(15), l(15) As Decimal Dim t As Decimal For b As Integer = 0 To 15 t = r(b) Dim ta As Decimal = l(b) And F(r(b)) r(b + 1) = l(b) And F(r(b)) l(b + 1) = t Next
Wayne
It is hard to understand how a cemetery can raise its burial rates and blame it on the cost of living.
It is hard to understand how a cemetery can raise its burial rates and blame it on the cost of living.
•
•
Join Date: Mar 2009
Posts: 3
Reputation:
Solved Threads: 0
Thanks for ur help.
again another problem came in the code.for first round,its giving result but from 2nd round to 16th round,its giving same result. may be from second round,its taking 0s in l() and r().
i placed this form code in the following link.can you see and help me?
thanks in advance..
Download link: http://rapidshare.com/files/21151808...pplication.zip
again another problem came in the code.for first round,its giving result but from 2nd round to 16th round,its giving same result. may be from second round,its taking 0s in l() and r().
i placed this form code in the following link.can you see and help me?
thanks in advance..
Download link: http://rapidshare.com/files/21151808...pplication.zip
![]() |
Similar Threads
- Find the biggest element in that array (C++)
- Inserting a number to an array (C++)
- PHP doesn't like array defined (PHP)
- Void* Array - HELP! (C)
- QuickSort Still Not Working?? (C)
- Why is qsort not initialised here!!?? (C)
- not-a-virusadware (Viruses, Spyware and other Nasties)
- Fun with Forms (PHP)
- How do I create a program using an Array ? (C++)
Other Threads in the VB.NET Forum
- Previous Thread: Add a new tool permanently to toolbox
- Next Thread: How do I get around this DataGrid silliness?
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account arithmetic array basic bing browser button buttons center check code combobox component crystalreport cuesent data database datagrid datagridview date datetimepicker dissertation dissertations dissertationtopic dropdownlist excel fade file-dialog filter ftp generatetags google hardcopy images input insert intel internet mobile monitor ms net networking objects output panel passingparameters pdf picturebox picturebox1 port position print printing problem problemwithinstallation project save searchbox searchvb.net select serial settings shutdown soap survey table tcp temperature text textbox timer timespan toolbox transparency trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf year





