Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invalid subscript reference
Message
 
 
To
29/08/2007 17:13:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01251239
Message ID:
01251246
Views:
26
Did you try to separate it, e.g.

lnRecsFound = alen(aRecs,1)
dimension aMinor[nMinor + lnRecsFound]

?

>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?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform