Thread: M&M 3rd ed. Receiving error on character
View Single Post
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old August 4th, 2016, 06:55 PM
Silly question, do you have all of the updates applied?

As it is, I can see where this is happening in the temporary data file generated in the ProgramData directory:

Code:
      ~ If we didn't find one, just get out
      if (firstrow = 0) then
        notify "Error - no entries in measurements array!"
        done
        endif

      ~ Now find the next entry that needs to be filled in, i.e. that has a
      ~ zero value
      var nextrow as number
      for i = firstrow+1 to field[maMassVal].arrayrows - 1
        if (nextrow = 0) then
          if (field[maMassVal].arrayvalue[i] = 0) then
            nextrow = i
            endif
          endif
        next

      ~ If all our entries are filled in, we're done
      doneif (nextrow >= field[maMassVal].arrayrows)

      ~ Just keep doubling the values until we get to the end of the array.
      var i as number
      for i = nextrow to field[maMassVal].arrayrows - 1
        field[maMassVal].arrayvalue[i] = field[maMassVal].arrayvalue[i-1] * 2
        field[maMassUnit].arraytext[i] = field[maMassUnit].arraytext[i-1]
        field[maMassUnPl].arraytext[i] = field[maMassUnPl].arraytext[i-1]
        field[maMass].arraytext[i] = field[maMassVal].arrayvalue[i] & " " & field[maMassUnPl].arraytext[i]

        field[maTimeVal].arrayvalue[i] = field[maTimeVal].arrayvalue[i-1] * 2
        field[maTimeUnit].arraytext[i] = field[maTimeUnit].arraytext[i-1]
        field[maTimeUnPl].arraytext[i] = field[maTimeUnPl].arraytext[i-1]
        field[maTime].arraytext[i] = field[maTimeVal].arrayvalue[i] & " " & field[maTimeUnPl].arraytext[i]

        field[maDistVal].arrayvalue[i] = field[maDistVal].arrayvalue[i-1] * 2
        field[maDistUnit].arraytext[i] = field[maDistUnit].arraytext[i-1]
        field[maDistUnPl].arraytext[i] = field[maDistUnPl].arraytext[i-1]
        field[maDist].arraytext[i] = field[maDistVal].arrayvalue[i] & " " & field[maDistUnPl].arraytext[i]

        field[maVolVal].arrayvalue[i] = field[maVolVal].arrayvalue[i-1] * 2
        field[maVolUnit].arraytext[i] = field[maVolUnit].arraytext[i-1]
        field[maVolUnPl].arraytext[i] = field[maVolUnPl].arraytext[i-1]
        field[maVol].arraytext[i] = field[maVolVal].arrayvalue[i] & " " & field[maVolUnPl].arraytext[i]
        next
Somehow, you're managing to get a nextRow of 0 instead of 1 (or maybe the array starts with 1), so the "i-1" values are outside of the array bounds.

Last edited by Duggan; August 4th, 2016 at 07:00 PM.
Duggan is offline   #6 Reply With Quote