Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > Software > Value of type Decimal cannot be converted to 1 dimensional array of Decimal

Thread Tools

Value of type Decimal cannot be converted to 1 dimensional array of Decimal

Neal Neal is offline
Junior Member
Join Date: Mar 2011
Posts: 1

I am taking my first quarter of computer programming, and I am running into a brick wall trying to understand jagged arrays in Visual Studio 2010. At the moment I am working on a program that uses two two dimensional jagged arrays, and I cannot figure out how to properly pass information into one of them. I have posted the code below. The part that is in bold is where the error message pops up that "Value of type decimal cannot be converted to 1 dimensional array of Decimal." Help!

If IsNothing(g_decChargesArray(g_intActivePatientNumb er)) Then
numVisits = 0
Dim decTemp(g_intActivePatientNumber) As Decimal
g_decChargesArray(g_intActivePatientNumber) = decTemp
Dim strTemp(0) As String
strTemp(0) = g_dtmDate.ToString("d")
g_strVisit(g_intActivePatientNumber) = strTemp
numVisits = g_decChargesArray(g_intActivePatientNumber).Length
End If
ReDim Preserve g_strVisit(g_strVisit.Length)
ReDim Preserve g_decChargesArray(g_decChargesArray.Length)
decCharges = CalcCharges()
If decCharges = -1 Then
MessageBox.Show("The Following Fields Will Only Accept Positive Numeric Values:" & vbCrLf & vbCrLf & "Length of Stay (Must be entered as whole number!)" & vbCrLf &
"Medical Charges" & vbCrLf & "Surgical Charges" & vbCrLf & "Lab Fees" & vbCrLf & "Physical Rehab Fees" &
vbCrLf & vbCrLf & "Please Review Your Entries and Correct Any Errors!")
g_decChargesArray(g_intActivePatientNumber) = decCharges
g_strVisit(g_intActivePatientNumber)(numVisits) = g_decTotal

End If
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
To convert a one dimensional array into a two dimensional array using C amrutha0303 Software 0 08-03-2010 10:02 PM
Object of type 'System.String' cannot be converted to type 'System Robert ASP .Net Building Controls 5 04-20-2006 09:00 AM
value of type "MyNamespace.MyClassName" cannot be converted to "MyNamespace.MyClassName" Mike Schnorr ASP .Net 0 06-25-2004 12:17 PM
Value of type 'String' cannot be converted to '1-dimensional array of System.Object' =?Utf-8?B?U2Vhbg==?= ASP .Net 2 02-06-2004 01:25 PM
How do copy Strings from a single dimensional array to double dimensional array Venkat C++ 4 12-05-2003 09:23 AM