| | |
need help to pass values to array in for loop
![]() |
•
•
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?
Views: 870 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2005 2008 access account ado.net application array arrays basic bindingsource browser c# center checkbox client code combobox connection control convert crystal crystalreport data database datagrid datagridview dataset datatable date datetimepicker design designer dissertation dissertations error excel file firewall form gridview image images insert listview login loops mobile ms msaccess net objects openxml path port print printing problem read save search security serial server settings shutdown sms socket sorting sql statement studio syntax tagging tags textbox time timer type update upload user validation vb vb.net vb2008 vbnet view visual visual-studio visualbasic visualstudio2008 vs2008 web webbrowser windows winforms wpf xml





