I've run the code (in debug mode) dozens of times trying to replicate the error and nMajor is initialized to 0 and is not updated until you hit this chunk of code.
>But in your code you didn't give how and where it is initialized. May be not local and changed by some other method.
>Cetin
>
>>Hi Cetin
>>
>>nMinor is initialized to 0 at the beginning of this screen and is not referenced again until that line of code.
>>
>>And no, there's no field by that name in the system
>>
>>
>>>>Hello Happy Peoples
>>>>
>>>>We're getting an intermitant error "Invalid subscript reference" and it points to a line of code that really doesn't make a lot of sense to me:
>>>>
>>>>
>>>>(other stuff going on here)
>>>>
>>>>aRecs( 1) = 0
>>>>select recno(), MasterId from Master ;
>>>> where ScanCode = m.ScanCode .and. ;
>>>> batch + sourcecode + status = cSeek .and. ;
>>>> MasterId <> m.MasterId ;
>>>>into array aRecs
>>>>if aRecs( 1) > 0
>>>> dimension aMinor( nMinor + alen( aRecs, 1)) <--------- error here
>>>> for i=1 to alen( aRecs, 1)
>>>> aMinor( nMinor + i) = lstr( aRecs( i, 1))
>>>> delete from MIndex where miSsn = aRecs( i, 2) .and. ;
>>>> left( miData, 1) $ cMICodes
>>>> next
>>>> nMinor = nMinor + alen( aRecs, 1)
>>>>endif
>>>>
>>>>Coming into this chunk o'code, nMinor = 0, but that shouldn't matter as long as aRecs has at least 1 member, should it?
>>>
>>>Are you sure nMinor is 0 there? You are not using mdot and maybe there is a field named nMinor in current workarea.
>>>Cetin
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place