Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot access characters beyond string
Message
From
20/08/1998 15:19:18
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
20/08/1998 09:15:03
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00128355
Message ID:
00128601
Views:
26
>Thanks guys for your help. I should have realized that was the problem. I am using two SUBSTR()'s Is there any way to tell VFP to only take the specified number of characters if it is available, and if not, just take all the characters in the field?
>
>Thanks again,
>Eric

You can omit the third parameter in Substr(), so it takes whatever it finds from the offset you gave, to the end of string. Thus, Substr("abcdef",3,2) gives you "cd", but Substr("abcdef",3) gives "cdef".

Nevertheless, Substr("abcdef",9,2) will surely give you an error. You should test for the length of the string first.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform