mid
Richard Kreiss
rkreiss at gccconsulting.net
Fri Dec 3 14:28:21 PST 2010
> -----Original Message-----
> From: Kenneth Brody [mailto:kenbrody at spamcop.net]
> Sent: Friday, December 03, 2010 5:12 PM
> To: rkreiss at gccconsulting.net
> Cc: Filepro-list at lists.celestial.com
> Subject: Re: mid
>
> On 12/3/2010 4:52 PM, Richard Kreiss wrote:
> > Have a program using the following type of code
> >
> > If:
> > Then: dim who(6);who["6"]="Cancel"
> >
> > This array is then filled in the form NNNN name
> >
> > If:
> > Then: sl(1,.0)=listbox(who)
> > If:
> > Then: 3=mid(who[sl],"1","4");ab=mid(who[sl],"6","30")
> >
> > Why am I getting a syntax error that points to [sl]?
>
> Perhaps you are running an ancient version of filePro?
>
> This small test generates no error in 5.6 or 5.0, though it does in 4.8:
>
> 1 ------- - - - - - - - - - - - - -
> ◄ If:
> Then: dim who(6)
> 2 ------- - - - - - - - - - - - - -
> ◄ If:
> Then: sl(1,.0) = listbox(who)
> 3 ------- - - - - - - - - - - - - -
> ◄ If:
> Then: xx = mid(who[sl],"1","4"); yy = mid(who[sl],"6","30")
>
> Unless, that is, you have a typo, and have "s1" rather than "sl".
>
> --
> Kenneth Brody
Problem solved, checked the map. It appears that I added a field who and never adjusted this program. When I changed the array to whose(6) and adjusted the program to use this array name, no syntax error.
My question is why the syntax error at who[sl] and not who("6"]="cancel" which is prior to the who[sl]. Only at the point where it needed to resolve which element did the error occur.
Richard
More information about the Filepro-list
mailing list