I think the latest way would be a better way to go.
BTW, I had the same error in VFP5. I believe, it's fixed in VFP6, so you would not have such errors regardless on SET TALK... Which VFP version are you using?
>Hi,
>
>This is concerning the error 'Cannot Access characters beyond string' and 'Set talk off/on'.
>
>I realized that using substr functions like substr(alltrim("ABC "),4,1), with SET TALK ON gives the Program Error - 'Cannot Access characters beyond string'
>
>But when Set Talk is OFF there are no errors and the above substr function returns an empty string. In my program, can, I just turn TALK OFF and thereby avoid the error? Would this be the right way to fix this problem? or do I need to verify the length of the strings and make sure that such substr functions are not executed?
>
>Ria
If it's not broken, fix it until it is.
My Blog