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

Discussion in 'Software' started by Neal, Mar 20, 2011.

  1. Neal

    Neal

    Joined:
    Mar 20, 2011
    Messages:
    1
    Hello,

    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_intActivePatientNumber)) 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
    Else
    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!")
    Return
    Else
    g_decChargesArray(g_intActivePatientNumber) = decCharges
    g_strVisit(g_intActivePatientNumber)(numVisits) = g_decTotal

    End If
    Neal, Mar 20, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Trs80
    Replies:
    0
    Views:
    420
    Trs80
    Jun 21, 2009
  2. amrutha0303
    Replies:
    0
    Views:
    950
    amrutha0303
    Aug 3, 2010
  3. amrutha0303
    Replies:
    0
    Views:
    2,078
    amrutha0303
    Aug 3, 2010
  4. RogueSpear00
    Replies:
    0
    Views:
    1,223
    RogueSpear00
    Mar 29, 2011
  5. konvictx
    Replies:
    0
    Views:
    1,198
    konvictx
    May 9, 2012
Loading...

Share This Page