Len() command

Everything else that doesn't fall into one of the other PB categories.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Len() command

Post by va!n »

If you have any string with Chr(13) ending and using Len() to get the stringlen, the Chr(13) will counted too. If you use something like Left() and trying to cut the string with the length you got by Len(), the string will still have a special char Chr(13)... I dont know if this is a feature or not...

Btw, what do you think about one more flag for Len() command? For example Len(string.s, flag) ...

flag 0 = Counting including special chars, like Chr(13)
flag 1 = Counting without adding stuff like Chr(13) ....

Code: Select all

text.s = "This is Art" + Chr(13)
a = Len(text.s) 
Debug a
Debug text.s
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Phoenix
Enthusiast
Enthusiast
Posts: 141
Joined: Sun Sep 04, 2005 2:25 am

Re: Len() command

Post by Phoenix »

va!n wrote:If you have any string with Chr(13) ending and using Len() to get the stringlen, the Chr(13) will counted too.
This is normal for all Basics and shouldn't be changed.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

agreed! (i was not really sure about this)
thanks! ;)
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Post Reply