>>>>>>>I need to return the size of a character string in bytes. Is there any function that can help me accomplish this task. I've tried _STRLEN() API but i can't seem to get the correct syntax.
>>>>>>>
>>>>>>>Any help is greatly appreciated!
>>>>>>>Thank in advance
>>>>>>
>>>>>>Just check field length: for characted field size=length, e.g. if length=12, size=12 bytes.
>>>>>
>>>>>One addition, if it's not field but character variable use LEN() function to return length=size.
>>
>>Sorry about the other message, but I pressed send by mistake... and Michel doesn't let us to make 2 replies to the same message!
>>
>>Why "if it's not field but character variable..."?!
>>
>>Vlad
>
>strlen = len(string) ie : len(" a string ") returns 10 including left and right trailing spaces. If needed you eliminate trailing spaces with ltrim(), rtrim() or trim(), alltrim().
>if you are asking for a field variable ie: Cust_name, len(cust_name) equals to the size of field, same as fsize("cust_name"). In this case you could use len(trim(cust_name)) to remove trailing spaces to get the entered value's length (rarely you need alltrim()). And finally values returned are equal to size in bytes (use c versions ie: lenc() if using double byte characters).
>Cetin
I'm sorry, but I really don't see where's the difference. BTW, Len() works fine for memo fields also.
Vlad
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only